[clang] [flang] [llvm] [CMake] Drop per-target LLVM_REQUIRES_RTTI (PR #174201)

Alexis Engelke via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 12 08:07:32 PST 2026


================
@@ -1,7 +1,10 @@
 # The interpreter can throw an exception from user input. The test binary needs
 # to be compiled with exception support to catch the thrown exception.
+#
+# NOTE: we compile with exceptions enabled, but (possibly) with RTTI disabled.
+# This only works in these limited circumstances where all exception-related
+# code is in the same library/executable.
----------------
aengelke wrote:

Sorry, I should've been more clear on my motivation: currently, we compile llvm_gtest with RTTI specifically for this test. If we want to use a PCH for gtest.h (we don't have to do this, but we could), all tests either need to be compiled with RTTI or without RTTI (otherwise, PCH command-line flags clash). We can't compile all tests with RTTI, but we can compile this currently only EH/RTTI-user without RTTI just fine. (For -fexceptions, this is not a problem: we already compile the gtest library with -fno-exceptions and tests with -fexceptions.)

Build system simplifications and MSVC-related potential (non-)issues are not the motivation, just side effects.

https://github.com/llvm/llvm-project/pull/174201


More information about the cfe-commits mailing list