================ @@ -2347,6 +2347,27 @@ Sema::BuildDeclRefExpr(ValueDecl *D, QualType Ty, ExprValueKind VK, return E; } +// Check whether a similar function-like macro exists and suggest it +static bool isFunctionLikeMacro(const DeclarationName &Name, Sema &SemaRef, + const SourceLocation &TypoLoc) { + + if (IdentifierInfo *II = Name.getAsIdentifierInfo()) { + if (II->hasMacroDefinition()) { + MacroInfo *MI = SemaRef.PP.getMacroInfo(II); + if (MI && MI->isFunctionLike()) { + SemaRef.Diag(TypoLoc, + diag::err_undeclared_var_use_suggest_func_like_macro) + << II->getName(); ---------------- AaronBallman wrote:
```suggestion << II; ``` This will ensure the name is properly quoted by the diagnostics engine. https://github.com/llvm/llvm-project/pull/123495 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits