File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,16 @@ function(add_llvm_target_unittest test_dir_name)
1414 add_llvm_unittest(${test_dir_name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN} )
1515endfunction ()
1616
17- # GCC may emit false positive warnings against LLVM's style guide.
17+ # gtest macros like EXPECT_TRUE are expanded to a single line
18+ # multi-statement code with if/else. eg:
19+ # if (...)
20+ # EXPECT_TURE(...)
21+ # will be expanded into something like:
22+ # if(...)
23+ # switch (0) case 0: default: if (...) ; else return;;
24+ # GCC may emit false positive dangling-else warnings for such code.
25+ # However, such warnings are actually against LLVM's style guide.
26+ # disable the warning for GCC so that one can enbable Werror.
1827if (CMAKE_COMPILER_IS_GNUCXX)
1928 list (APPEND LLVM_COMPILE_FLAGS "-Wno-dangling-else" )
2029endif ()
You can’t perform that action at this time.
0 commit comments