-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Description
As reported by @francoechea in google/googlemock#211 , in the expansion of MATCHER_P there's a -Wdeprecated warning by Clang because the class defines a copy assignment operator (to make it private), but does not define a copy constructor, and implicit copy constructor generation is deprecated in such cases in C++11:
definition of implicit copy constructor for 'FooMatcherP2<double, double>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated]
When I bumped into this myself, I tried simply adding a copy constructor like:
name##MatcherP(const name##MatcherP &other) : p0(other.p0) {\
}\
to the MATCHER_P macro I was using, and it seemed to work.
Should perhaps whatever code generates these MATCHER_P macros make sure they have explicitly defined copy constructors like this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels