boostorg / polygon

Boost.org polygon module
http://boost.org/libs/polygon
57 stars 70 forks source link

Address Clang 10 [-Wdeprecated-copy] warning. #37

Closed helixhorned closed 4 years ago

helixhorned commented 4 years ago

("definition of implicit copy constructor for 'robust_fpt' is deprecated because it has a user-declared copy assignment operator")


One of two warnings that I encountered when building with LLVM 10.

The other one is:

boost-polygon/polygon_45_set_data.hpp:1662:24: warning: local variable 'str' will be copied despite being thrown by name [-Wreturn-std-move]
        } else { throw str; }
                       ^~~
boost/polygon/polygon_45_set_data.hpp:1662:24: note: call 'std::move' explicitly to avoid copying
        } else { throw str; }
                       ^~~
                       std::move(str)

(And again on line 1773.)

However, I omitted that one because I don't know how far back in terms of C++ Standard Boost aims to be compatible with. Probably there is a macro wrapping std::move?

asydorchuk commented 4 years ago

Thanks! Merged.

glenfe commented 4 years ago

This isn't the right change. Instead of explicitly adding a copy constructor here we should be removing the explicit operator=. When both are implicitly generated you shouldn't get this warning.