[clang] [clang-tools-extra] Reland [clang][Sema, Lex, Parse] Preprocessor embed in C and C++ (PR #95802)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 10 04:59:28 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<
----------------
AaronBallman wrote:
> Is there a reason why this is a ExtWarn and not Extension?
We're consistently inconsistent; if you look through `DiagnosticParseKinds.td` you'll see we're all over the place. I think the organic rule tends to be whether the patch author thinks the failure mode from not noticing use of the extension will be disruptive or not.
I think for the preprocessor we'd generally use `ExtWarn` for new directives because those are *really* not portable and can lead to some very odd follow-on diagnostics. That's why we went with `ExtWarn` for `#elifdef` (also new in C23), though I think it's less of a concern with `#embed`.
https://github.com/llvm/llvm-project/pull/95802
More information about the cfe-commits
mailing list