[clang] [clang-tools-extra] Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (PR #95802)

Karl-Johan Karlsson via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 02:51:41 PDT 2026


================
@@ -436,6 +436,14 @@ def warn_cxx23_compat_warning_directive : Warning<
 def warn_c23_compat_warning_directive : Warning<
   "#warning is incompatible with C standards before C23">,
   InGroup<CPre23Compat>, DefaultIgnore;
+def ext_pp_embed_directive : ExtWarn<
----------------
karka228 wrote:

Is there a reason why this is a `ExtWarn` and not `Extension`? The difference as I understand it is that with `ExtWarn` you always get the warning if you compile with a C standard before C23, but with `Extension` you get it only with the option `-Wpedantic`. Isn't that how it is normally handled?

If we compare with `_BitInt` that also is a C23 feature it is handled as `Extension`:
```
def ext_bit_int : Extension<
  "'_BitInt' in %select{C17 and earlier|C++}0 is a Clang extension">,
```

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


More information about the cfe-commits mailing list