================
@@ -922,6 +928,24 @@ bool Preprocessor::HandleIdentifier(Token &Identifier) {
if (const MacroDefinition MD = getMacroDefinition(&II)) {
const auto *MI = MD.getMacroInfo();
assert(MI && "macro definition with no macro info?");
+ // C++ [cpp.pre]/p4, [cpp.cond]/p9: if one of the pp-tokens of a #embed
+ // directive (or a has-embed-expression) is the identifier limit, prefix,
+ // suffix, or if_empty and that identifier is defined as a macro, the
+ // program is ill-formed.
+ //
+ // Thus, do not continue processing if compiling for C++. C doesn't have
+ // this restriction however, so only issue a warning for C if -Wc++-compat
+ // is enabled.
----------------
Fznamznon wrote:
I find it weird that C++ diverges from C anyhow for a feature that new. Does it
actually? That is not good
https://github.com/llvm/llvm-project/pull/224769
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits