[clang] [Clang] Move the builtin workaround logic to the lexer (PR #96097)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 29 08:52:09 PDT 2024


================
@@ -1673,6 +1673,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) {
         return II && HasExtension(*this, II->getName());
       });
   } else if (II == Ident__has_builtin) {
+    EvaluatingHasBuiltinMacro = true;
----------------
Endilll wrote:

I'm not particularly proud of this workaround, and if reviewers think that we should do this in some other way (e.g. enable backtracking for every `__has_builtin` use, and look behind when we see a revertible type trait identifier), I'm open for suggestions.

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


More information about the cfe-commits mailing list