[clang] [Clang] prevent crash on unterminated __has_embed (PR #163107)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 14 07:45:28 PDT 2025


================
@@ -250,3 +250,35 @@
 
 #if __has_embed("") // expected-error {{empty filename}}
 #endif
+
+// expected-error at +9 {{unterminated conditional directive}}
+// expected-error at +13 {{unterminated conditional directive}}
+// expected-error at +17 {{unterminated conditional directive}}
+// expected-error at +21 {{unterminated conditional directive}}
+// expected-error at +25 {{unterminated conditional directive}}
----------------
Fznamznon wrote:

Are you saying that an invalid directive affects the parsing of `// expected-error` comments making the test not really testing anything and we avoid this problem by putting each failing directive to a separate file?

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


More information about the cfe-commits mailing list