================
@@ -270,8 +270,13 @@ classifyTokensBeforeFunctionName(const FunctionDecl &F,
const ASTContext &Ctx,
if (Info.hasMacroDefinition()) {
const MacroInfo *MI = PP->getMacroInfo(&Info);
- if (!MI || MI->isFunctionLike()) {
- // Cannot handle function style macros.
+ if (!MI || MI->isFunctionLike() || MI->isBuiltinMacro()) {
+ // Cannot handle function-like macros or builtin macros.
+ // Builtin macros like __has_feature, __has_builtin, etc. are
+ // registered as object-like macros but expect function-like syntax
+ // (parenthesized arguments) when expanded. Feeding them to
+ // classifyToken() would cause the preprocessor to emit spurious
+ // "missing '(' after '...'" errors.
----------------
zeyi2 wrote:
> Maybe even remove the comment entirely?
+1 on this :)
https://github.com/llvm/llvm-project/pull/184022
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits