[clang] [clang] Clear `NeedsCleaning` flag after `ExpandBuiltinMacro` (PR #133574)

marius doerner via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 31 12:50:36 PDT 2025


================
@@ -1646,7 +1646,6 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
 
   // Set up the return result.
   Tok.setIdentifierInfo(nullptr);
-  Tok.clearFlag(Token::NeedsCleaning);
----------------
mariusdr wrote:

True, my bad. If the flag is removed we can get asserts on __DATE__ and __TIME__ expansion. I've put it back and added some test cases to account for this (also for some similar macros like __LINE__, __FILE__ which do not early return but are easily tested in the same way). 

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


More information about the cfe-commits mailing list