-
Notifications
You must be signed in to change notification settings - Fork 203
Unwanted warning when compiling with Clang #211
Description
When creating any custom matchers with macros (for example MATCHER_P2(Foo, x0, x1, "")) the Clang compiler is complaining because "definition of implicit copy constructor for 'FooMatcherP2<double, double>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated]"
I know this is only because we are treating every warning as an error but I was wondering if this issue has been reported/solved before. We are using gmock 1.7.
Here is the full compiler output related to this error:
error: definition of implicit copy constructor for 'FooMatcherP2<double, double>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated]
20:50:13 MATCHER_P2(Foo, expected, reltol, "") {
20:50:13 ^
20:50:13 gmock/gmock-1.7.0/include/gmock/gmock-generated-matchers.h:1533:5: note: expanded from macro 'MATCHER_P2'
20:50:13 GTEST_DISALLOW_ASSIGN_(name##MatcherP2);
20:50:13 ^
20:50:13 gmock/gmock-1.7.0/gtest/include/gtest/internal/gtest-port.h:722:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
20:50:13 void operator=(type const &)
20:50:13 ^
20:50:13 test/Foo.cxx:56:30: note: in instantiation of function template specialization 'Foo<double, double>' requested here
20:50:13 ASSERT_THAT(actual, Foo(expected, tol));
20:50:13 ^
20:50:13 gmock/gmock-1.7.0/include/gmock/gmock-matchers.h:3980:60: note: expanded from macro 'ASSERT_THAT'
20:50:13 ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
20:50:13 ^
20:50:13 gmock/gmock-1.7.0/gtest/include/gtest/gtest_pred_impl.h:118:23: note: expanded from macro 'ASSERT_PRED_FORMAT1'
20:50:13 GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
20:50:13 ^
20:50:13 gmock/gmock-1.7.0/gtest/include/gtest/gtest_pred_impl.h:101:17: note: expanded from macro 'GTEST_PRED_FORMAT1_'
20:50:13 GTEST_ASSERT_(pred_format(#v1, v1),
20:50:13 ^
20:50:13 gmock/gmock-1.7.0/gtest/include/gtest/gtest_pred_impl.h:77:52: note: expanded from macro 'GTEST_ASSERT_'
20:50:13 if (const ::testing::AssertionResult gtest_ar = (expression)) \