Skip to content
This repository has been archived by the owner on Jul 17, 2019. It is now read-only.

Unwanted warning when compiling with Clang #211

Open
francoechea opened this issue Oct 4, 2017 · 2 comments
Open

Unwanted warning when compiling with Clang #211

francoechea opened this issue Oct 4, 2017 · 2 comments

Comments

@francoechea
Copy link

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)) \

@estan
Copy link

estan commented Oct 21, 2017

I'm running into this as well :( (with 1.8.0)

@estan
Copy link

estan commented Oct 21, 2017

Since all issues for googlemock have been moved to the google/googletest repo, I opened an issue there instead: google/googletest#1305.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants