From 3c3bf73840970d577e51e439b6fd2eaca14d8adc Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 1 Nov 2018 20:31:44 +0000 Subject: [PATCH] Enable -Wimplicit-fallthrough for clang as well as GCC All instances of this warning should already be fixed across all LLVM subprojects, at least on Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345887 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/HandleLLVMOptions.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 05db1b076a1..b590f768244 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -580,6 +580,7 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL)) append("-Wno-long-long" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) endif() + add_flag_if_supported("-Wimplicit-fallthrough" IMPLICIT_FALLTHROUGH_FLAG) add_flag_if_supported("-Wcovered-switch-default" COVERED_SWITCH_DEFAULT_FLAG) append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS) append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)