[llvm] [NFC] [CMake] Add -Wno-dangling-else for GCC built unittests (PR #112817)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 28 01:34:00 PDT 2024
================
@@ -14,6 +14,20 @@ function(add_llvm_target_unittest test_dir_name)
add_llvm_unittest(${test_dir_name} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
endfunction()
+# gtest macros like EXPECT_TRUE are expanded to a single line
+# multi-statement code with if/else. eg:
+# if (...)
+# EXPECT_TURE(...)
+# will be expanded into something like:
+# if(...)
+# switch (0) case 0: default: if (...) ; else return;;
----------------
jh7370 wrote:
`EXPECT_TURE` -> `EXPECT_TRUE`
`if(...)` -> `if (...)`
https://github.com/llvm/llvm-project/pull/112817
More information about the llvm-commits
mailing list