googletest icon indicating copy to clipboard operation
googletest copied to clipboard

Deprecated implicit copy assignment/constructor

Open omartijn opened this issue 6 years ago • 5 comments

I am having trouble getting googletest to compile. The problem is that many classes rely on a default move constructor while defining a copy or move assignment operator. This has been deprecated and the compiler rightly complains about this.

Since googletest also defines warnings as errors it means it just doesn't work.

omartijn avatar Apr 08 '19 12:04 omartijn

Example:

<path>/googletest/googlemock/src/gmock-spec-builders.cc:849:14: warning: definition of implicit copy assignment
      operator for 'Expectation' is deprecated because it has a user-declared destructor [-Wdeprecated]
Expectation::~Expectation() {}
             ^
<path>/googletest/googlemock/src/gmock-spec-builders.cc:858:24: note: in implicit copy assignment operator for
      'testing::Expectation' first required here
    *last_expectation_ = expectation;

omartijn avatar Apr 08 '19 12:04 omartijn

Anybody working on this? I'd make a PR to fix it, but I've tried it in the past and could not get past the cla-bot. I'd rather not repeat that experience.

omartijn avatar Sep 30 '19 09:09 omartijn

Ping.

LLVM hit this issue with gtest too.

davidbolvansky avatar Nov 24 '19 14:11 davidbolvansky

This is also affecting clients of google myanmar-tools: https://github.com/google/myanmar-tools/issues/42

sffc avatar Jan 17 '20 12:01 sffc

This was fixed in https://github.com/google/googletest/pull/2815

namazso avatar Jul 18 '22 09:07 namazso