[clang] [clang] Check empty macro name in `#pragma push_macro("")` or `#pragma pop_macro("")` (PR #149982)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 22 04:33:28 PDT 2025


================
@@ -604,6 +604,10 @@ IdentifierInfo *Preprocessor::ParsePragmaPushOrPopMacro(Token &Tok) {
   assert(StrVal[0] == '"' && StrVal[StrVal.size()-1] == '"' &&
          "Invalid string token!");
 
+  // FIXME: Should we emit a warning?
----------------
AaronBallman wrote:

I think we should emit a warning for this because it's a bit of a confusing construct; MSVC does: https://godbolt.org/z/cs1xn5M8T (GCC does not)

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


More information about the cfe-commits mailing list