diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -668,6 +668,11 @@ if (LLVM_ENABLE_PEDANTIC AND LLVM_COMPILER_IS_GCC_COMPATIBLE) append("-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) append("-Wno-long-long" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + + # GCC warns about redundant toplevel semicolons (enabled by -pedantic + # above), while Clang doesn't. Enable the corresponding Clang option to + # pick up on these even in builds with Clang. + add_flag_if_supported("-Wc++98-compat-extra-semi" C98_COMPAT_EXTRA_SEMI_FLAG) endif() add_flag_if_supported("-Wimplicit-fallthrough" IMPLICIT_FALLTHROUGH_FLAG)