Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit f77b254

Browse files
rnkmati865
authored andcommitted
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337492 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 0368490 commit f77b254

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
579579
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
580580
append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)
581581

582+
# Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on
583+
# LLVM's ADT classes.
584+
check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
585+
append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)
586+
582587
# Check if -Wnon-virtual-dtor warns even though the class is marked final.
583588
# If it does, don't add it. So it won't be added on clang 3.4 and older.
584589
# This also catches cases when -Wnon-virtual-dtor isn't supported by

0 commit comments

Comments
 (0)