Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix instances of -Wdeprecated-copy #3427

Open
PiJoules opened this issue Jun 1, 2021 · 4 comments
Open

Fix instances of -Wdeprecated-copy #3427

PiJoules opened this issue Jun 1, 2021 · 4 comments
Assignees
Labels

Comments

@PiJoules
Copy link

PiJoules commented Jun 1, 2021

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

@PiJoules PiJoules added the bug label Jun 1, 2021
@derekmauro derekmauro self-assigned this Jun 7, 2021
jbigot added a commit to pdidev/dockerfiles that referenced this issue Dec 24, 2021
@gpshead
Copy link

gpshead commented Dec 26, 2021

f790280 at least works around this in googletest's own cmake file by removing -Werror.

The code bug still needs fixing.

@StrongerXi
Copy link

StrongerXi commented May 17, 2022

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.

@namazso
Copy link

namazso commented Jul 18, 2022

This was fixed in #2815

asfgit pushed a commit to apache/kudu that referenced this issue Sep 1, 2022
Along with other fixes and updates, googletest v1.12.1 includes the fix
that allows for building the library with CLANG 13 and newer [1].

[1] google/googletest#3427

Change-Id: Ic1a398cbb93a6edb918e84e05927feb4b067058c
Reviewed-on: http://gerrit.cloudera.org:8080/18922
Reviewed-by: Attila Bukor <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
zhangyifan27 pushed a commit to zhangyifan27/kudu that referenced this issue Dec 28, 2022
Along with other fixes and updates, googletest v1.12.1 includes the fix
that allows for building the library with CLANG 13 and newer [1].

[1] google/googletest#3427

Change-Id: Ic1a398cbb93a6edb918e84e05927feb4b067058c
Reviewed-on: http://gerrit.cloudera.org:8080/18922
Reviewed-by: Attila Bukor <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
@tmm1
Copy link

tmm1 commented Jan 27, 2023

Can this issue be closed if the problem was fixed?

facebook-github-bot pushed a commit to facebook/mariana-trench that referenced this issue Feb 13, 2023
Summary:
We were using 1.10 which has deprecation warnings which were failing builds: google/googletest#3427

Update the version, and update the format of the URL as well as the artifact directory, which have changed since the before times.

Reviewed By: arthaud

Differential Revision: D43247530

fbshipit-source-id: cc808e4b05e7df24c4655877dbb0a3e3b9fafc22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants