@@ -876,52 +876,42 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
876
876
append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS )
877
877
append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS )
878
878
879
- # Disable -Wnonnull for GCC warning as it is emitting a lot of false positives.
880
879
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
880
+ # Disable -Wnonnull for GCC warning as it is emitting a lot of false positives.
881
881
append ("-Wno-nonnull" CMAKE_CXX_FLAGS )
882
- endif ()
883
882
884
- # Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on
885
- # LLVM's ADT classes.
886
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
883
+ # Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on
884
+ # LLVM's ADT classes.
887
885
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
888
886
append ("-Wno-class-memaccess" CMAKE_CXX_FLAGS )
889
887
endif ()
890
- endif ()
891
888
892
- # Disable -Wdangling-reference, a C++-only warning from GCC 13 that seems
893
- # to produce a large number of false positives.
894
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
889
+ # Disable -Wdangling-reference, a C++-only warning from GCC 13 that seems
890
+ # to produce a large number of false positives.
895
891
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1)
896
892
append ("-Wno-dangling-reference" CMAKE_CXX_FLAGS )
897
893
endif ()
898
- endif ()
899
894
900
- # Disable -Wredundant-move and -Wpessimizing-move on GCC>=9. GCC wants to
901
- # remove std::move in code like
902
- # "A foo(ConvertibleToA a) { return std::move(a); }",
903
- # but this code does not compile (or uses the copy
904
- # constructor instead) on clang<=3.8. Clang also has a -Wredundant-move and
905
- # -Wpessimizing-move, but they only fire when the types match exactly, so we
906
- # can keep them here.
907
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
895
+ # Disable -Wredundant-move and -Wpessimizing-move on GCC>=9. GCC wants to
896
+ # remove std::move in code like
897
+ # "A foo(ConvertibleToA a) { return std::move(a); }",
898
+ # but this code does not compile (or uses the copy
899
+ # constructor instead) on clang<=3.8. Clang also has a -Wredundant-move and
900
+ # -Wpessimizing-move, but they only fire when the types match exactly, so we
901
+ # can keep them here.
908
902
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.1)
909
903
append ("-Wno-redundant-move" CMAKE_CXX_FLAGS )
910
904
append ("-Wno-pessimizing-move" CMAKE_CXX_FLAGS )
911
905
endif ()
912
- endif ()
913
906
914
- # Disable -Warray-bounds on GCC; this warning exists since a very long time,
915
- # but since GCC 11, it produces a lot of very noisy, seemingly false positive
916
- # warnings (potentially originating in libstdc++).
917
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
907
+ # Disable -Warray-bounds on GCC; this warning exists since a very long time,
908
+ # but since GCC 11, it produces a lot of very noisy, seemingly false positive
909
+ # warnings (potentially originating in libstdc++).
918
910
append ("-Wno-array-bounds" CMAKE_CXX_FLAGS )
919
- endif ()
920
911
921
- # Disable -Wstringop-overread on GCC; this warning produces a number of very
922
- # noisy diagnostics when -Warray-bounds is disabled above; this option exists
923
- # since GCC 11.
924
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
912
+ # Disable -Wstringop-overread on GCC; this warning produces a number of very
913
+ # noisy diagnostics when -Warray-bounds is disabled above; this option exists
914
+ # since GCC 11.
925
915
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.1)
926
916
append ("-Wno-stringop-overread" CMAKE_CXX_FLAGS )
927
917
endif ()
0 commit comments