summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-07-19 20:14:46 +0000
committerReid Kleckner <rnk@google.com>2018-07-19 20:14:46 +0000
commit2efa05be2f30029d57145a13ae2ecdd8775c28cb (patch)
tree93439e64841f952731738f7ba865a746c2f5b496
parent9888670c6be9d811e275e3faf40eb694d551a6a2 (diff)
downloadbcm5719-llvm-2efa05be2f30029d57145a13ae2ecdd8775c28cb.tar.gz
bcm5719-llvm-2efa05be2f30029d57145a13ae2ecdd8775c28cb.zip
Disable GCC's -Wclass-memaccess warning
It fires on things like SmallVector<std::pair<int, int>>, where we intentionally use memcpy instead of calling the assignment operator. This warning fires in practically every LLVM TU, so we have to do something about it, even if we aren't interested in being 100% warning clean with GCC. Reported as PR37337 llvm-svn: 337492
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 3d2dd48018c..efaad89f20c 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -579,6 +579,11 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)
+ # Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on
+ # LLVM's ADT classes.
+ check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
+ append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)
+
# Check if -Wnon-virtual-dtor warns even though the class is marked final.
# If it does, don't add it. So it won't be added on clang 3.4 and older.
# This also catches cases when -Wnon-virtual-dtor isn't supported by
OpenPOWER on IntegriCloud