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]
dbl001 opened this issue · comments
dbl commented
I got this error build FBGEMM on MacOS Ventura 13.0.1 with clang 14.0.0.
% cmake -B build
CMake Warning (dev) at /opt/local/share/cmake-3.24/Modules/GNUInstallDirs.cmake:243 (message):
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
target architecture is known. Please enable at least one language before
including GNUInstallDirs.
Call Stack (most recent call first):
CMakeLists.txt:6 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: /Users/davidlaxer/anaconda3/bin/python (found version "3.8.15")
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- The C compiler identification is AppleClang 14.0.0.14000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test COMPILER_SUPPORTS_AVX512
-- Performing Test COMPILER_SUPPORTS_AVX512 - Success
-- Found OpenMP_C: -Xclang -fopenmp (found version "5.0")
-- Found OpenMP_CXX: -Xclang -fopenmp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
CMake Warning at CMakeLists.txt:87 (message):
OpenMP found! OpenMP_C_INCLUDE_DIRS = /Users/davidlaxer/anaconda3/include
CMake Warning at CMakeLists.txt:186 (message):
==========
CMake Warning at CMakeLists.txt:187 (message):
CMAKE_BUILD_TYPE = Release
CMake Warning at CMakeLists.txt:188 (message):
CMAKE_CXX_FLAGS_DEBUG is -g
CMake Warning at CMakeLists.txt:189 (message):
CMAKE_CXX_FLAGS_RELEASE is -O3 -DNDEBUG
CMake Warning at CMakeLists.txt:190 (message):
==========
-- Performing Test __CxxFlag__fno_threadsafe_statics
-- Performing Test __CxxFlag__fno_threadsafe_statics - Success
-- Performing Test __CxxFlag__fno_semantic_interposition
-- Performing Test __CxxFlag__fno_semantic_interposition - Failed
-- Performing Test __CxxFlag__fmerge_all_constants
-- Performing Test __CxxFlag__fmerge_all_constants - Success
-- Performing Test __CxxFlag__fno_enforce_eh_specs
-- Performing Test __CxxFlag__fno_enforce_eh_specs - Failed
** AsmJit Summary **
ASMJIT_DIR=/Users/davidlaxer/pytorch/FBGEMM/third_party/asmjit
ASMJIT_TEST=FALSE
ASMJIT_TARGET_TYPE=STATIC
ASMJIT_DEPS=pthread
ASMJIT_LIBS=asmjit;pthread
ASMJIT_CFLAGS=-DASMJIT_STATIC
ASMJIT_PRIVATE_CFLAGS=-Wall;-Wextra;-Wconversion;-fno-math-errno;-fno-threadsafe-statics;-DASMJIT_STATIC
ASMJIT_PRIVATE_CFLAGS_DBG=
ASMJIT_PRIVATE_CFLAGS_REL=-O2;-fmerge-all-constants
-- Performing Test HAS_WNO_DEPRECATED_COPY
-- Performing Test HAS_WNO_DEPRECATED_COPY - Success
-- Performing Test HAS_WNO_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAS_WNO_UNUSED_BUT_SET_VARIABLE - Success
CMake Warning (dev) at third_party/cpuinfo/CMakeLists.txt:6 (PROJECT):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
PROJECT_VERSION
PROJECT_VERSION_MAJOR
PROJECT_VERSION_MINOR
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning at test/CMakeLists.txt:17 (message):
gtest_force_shared_crt is OFF
CMake Deprecation Warning at third_party/googletest/CMakeLists.txt:4 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at third_party/googletest/googlemock/CMakeLists.txt:45 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at third_party/googletest/googletest/CMakeLists.txt:56 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- OpenMP_LIBRARIES= /Users/davidlaxer/anaconda3/lib/libomp.dylib
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m]
-- Library mkl_intel_lp64: /Users/davidlaxer/anaconda3/lib/libmkl_intel_lp64.dylib
-- Library mkl_intel_thread: /Users/davidlaxer/anaconda3/lib/libmkl_intel_thread.dylib
-- Library mkl_core: /Users/davidlaxer/anaconda3/lib/libmkl_core.dylib
-- Library iomp5: /Users/davidlaxer/anaconda3/lib/libiomp5.dylib
-- Library pthread: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/lib/libpthread.tbd
-- Library m: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/lib/libm.tbd
-- Looking for cblas_sgemm
-- Looking for cblas_sgemm - found
-- MKL library found
-- OpenMP_LIBRARIES= /Users/davidlaxer/anaconda3/lib/libomp.dylib
-- MKL_LIBRARIES= /Users/davidlaxer/anaconda3/lib/libmkl_intel_lp64.dylib;/Users/davidlaxer/anaconda3/lib/libmkl_intel_thread.dylib;/Users/davidlaxer/anaconda3/lib/libmkl_core.dylib;/Users/davidlaxer/anaconda3/lib/libiomp5.dylib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/lib/libpthread.tbd;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/lib/libm.tbd
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/davidlaxer/pytorch/FBGEMM/build
...
[ 71%] Building CXX object googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o
In file included from /Users/davidlaxer/pytorch/FBGEMM/third_party/googletest/googlemock/src/gmock_main.cc:32:
In file included from /Users/davidlaxer/anaconda3/include/gmock/gmock.h:59:
/Users/davidlaxer/anaconda3/include/gmock/gmock-actions.h:455: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);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-actions.h:1011:10: note: in implicit copy constructor for 'testing::PolymorphicAction<testing::internal::ReturnNullAction>' first required here
return MakePolymorphicAction(internal::ReturnNullAction());
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-actions.h:455:3: error: definition of implicit copy constructor for 'PolymorphicAction<testing::internal::ReturnVoidAction>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-actions.h:1016:10: note: in implicit copy constructor for 'testing::PolymorphicAction<testing::internal::ReturnVoidAction>' first required here
return MakePolymorphicAction(internal::ReturnVoidAction());
^
In file included from /Users/davidlaxer/pytorch/FBGEMM/third_party/googletest/googlemock/src/gmock_main.cc:32:
In file included from /Users/davidlaxer/anaconda3/include/gmock/gmock.h:61:
In file included from /Users/davidlaxer/anaconda3/include/gmock/gmock-function-mocker.h:39:
In file included from /Users/davidlaxer/anaconda3/include/gmock/gmock-generated-function-mockers.h:47:
In file included from /Users/davidlaxer/anaconda3/include/gmock/gmock-spec-builders.h:75:
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:1506:3: error: definition of implicit copy constructor for 'FloatingEqMatcher<double>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3632:10: note: in implicit copy constructor for 'testing::internal::FloatingEqMatcher<double>' first required here
return internal::FloatingEqMatcher<double>(rhs, false);
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:1506:3: error: definition of implicit copy constructor for 'FloatingEqMatcher<float>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3660:10: note: in implicit copy constructor for 'testing::internal::FloatingEqMatcher<float>' first required here
return internal::FloatingEqMatcher<float>(rhs, false);
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:721:3: error: definition of implicit copy constructor for 'StrEqualityMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StrEqualityMatcher<std::string>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3813:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StrEqualityMatcher<std::string>>' first required here
return MakePolymorphicMatcher(
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:778:3: error: definition of implicit copy constructor for 'HasSubstrMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::HasSubstrMatcher<std::string>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3842:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::HasSubstrMatcher<std::string>>' first required here
return MakePolymorphicMatcher(
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:835:3: error: definition of implicit copy constructor for 'StartsWithMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StartsWithMatcher<std::string>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3849:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StartsWithMatcher<std::string>>' first required here
return MakePolymorphicMatcher(
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:891:3: error: definition of implicit copy constructor for 'EndsWithMatcher<std::string>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::EndsWithMatcher<std::string>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3856:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::EndsWithMatcher<std::string>>' first required here
return MakePolymorphicMatcher(internal::EndsWithMatcher<std::string>(suffix));
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:721:3: error: definition of implicit copy constructor for 'StrEqualityMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StrEqualityMatcher<std::wstring>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3865:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StrEqualityMatcher<std::wstring>>' first required here
return MakePolymorphicMatcher(
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:778:3: error: definition of implicit copy constructor for 'HasSubstrMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::HasSubstrMatcher<std::wstring>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3894:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::HasSubstrMatcher<std::wstring>>' first required here
return MakePolymorphicMatcher(
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:835:3: error: definition of implicit copy constructor for 'StartsWithMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::StartsWithMatcher<std::wstring>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3901:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::StartsWithMatcher<std::wstring>>' first required here
return MakePolymorphicMatcher(
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:891:3: error: definition of implicit copy constructor for 'EndsWithMatcher<std::wstring>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
^
/Users/davidlaxer/anaconda3/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
void operator=(type const &) = delete
^
/Users/davidlaxer/anaconda3/include/gtest/gtest-matchers.h:454:7: note: in implicit copy constructor for 'testing::internal::EndsWithMatcher<std::wstring>' first required here
class PolymorphicMatcher {
^
/Users/davidlaxer/anaconda3/include/gmock/gmock-matchers.h:3908:10: note: in implicit move constructor for 'testing::PolymorphicMatcher<testing::internal::EndsWithMatcher<std::wstring>>' first required here
return MakePolymorphicMatcher(
^
12 errors generated.
make[2]: *** [googletest/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o] Error 1
make[1]: *** [googletest/googlemock/CMakeFiles/gmock_main.dir/all] Error 2
make: *** [all] Error 2
(base) davidlaxer@x86_64-apple-darwin13 FBGEMM %
Jianyu Huang commented
Looks like this is a build failure on googletest ? Have you tried to build a standalone google test to check if it can pass?
Jianyu Huang commented
Sorry just saw #1494 . Will upgrade googltest.
Benson Ma commented
We have upgraded GoogleTest to 1.13 a while back, which I think should fix the issue reported. Feel free to re-file if this issue persists.