googletest
googletest copied to clipboard
Fix instances of -Wdeprecated-copy
Bloaty fails to build with ToT clang due to more aggressive changes to -Wdeprecated-copy.
[6/17] Building CXX object third_party/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
FAILED: third_party/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
/usr/local/google/home/leonardchan/fuchsia/prebuilt/third_party/goma/linux-x64/gomacc /usr/local/google/home/leonardchan/fuchsia/prebuilt/third_party/clang/linux-x64/bin/clang++ --target=x86_64-linux-gnu -D_LIBCXXABI_FUNC_VIS="" -I../third_party/re2 -I../third_party/capstone/include -I../. -I../src -I../third_party/abseil-cpp -Isrc -I../third_party/googletest/googlemock/include -I../third_party/googletest/googlemock -isystem ../third_party/protobuf/src -isystem ../third_party/googletest/googletest/include -isystem ../third_party/googletest/googletest -std=c++11 -W -Wall -Wno-sign-compare -fdiagnostics-color=always -O2 -Wall -Wshadow -Werror -Wconversion -DGTEST_HAS_PTHREAD=1 -fexceptions -W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls -std=c++11 -MD -MT third_party/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o -MF third_party/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o.d -o third_party/googletest/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o -c ../third_party/googletest/googlemock/src/gmock-all.cc
In file included from ../third_party/googletest/googlemock/src/gmock-all.cc:39:
In file included from ../third_party/googletest/googlemock/include/gmock/gmock.h:59:
../third_party/googletest/googlemock/include/gmock/gmock-actions.h:454:3: error: definition of implicit copy constructor for 'PolymorphicAction<testing::internal::ReturnNullAction>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
^
../third_party/googletest/googletest/include/gtest/internal/gtest-port.h:679:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
../third_party/googletest/googlemock/include/gmock/gmock-actions.h:1010:10: note: in implicit copy constructor for 'testing::PolymorphicAction<testing::internal::ReturnNullAction>' first required here
return MakePolymorphicAction(internal::ReturnNullAction());
^
While the warning can be disabled, we should clean up instances this warning appears.
This can be reproduced with the same instructions used for building bloaty, but with using a version of clang that contains at least revision abf3ca61e3235681f26d0f527b8e2763dd4c0c62. (The revision I used locally is f7c5c0d87b8ae5e55006fd3a31994cd68d64f102.)
https://github.com/google/googletest/commit/f7902802f1a61140e188223fb6d1c95925cbec4a at least works around this in googletest's own cmake file by removing -Werror.
The code bug still needs fixing.
Anybody working on this? I'm seeing the exact same error when building flashlight. If I switch from 1.10.0 to 1.8.1, the error disappears.
This was fixed in https://github.com/google/googletest/pull/2815
Can this issue be closed if the problem was fixed?