[Macros] Don't invoke ResolveMacroRequest for the same custom attribute with

different DeclContexts.
This commit is contained in:
Holly Borla
2023-02-15 14:58:24 -08:00
parent c33c925e81
commit f1953f311f
3 changed files with 15 additions and 2 deletions

View File

@@ -698,7 +698,7 @@ bool SemaAnnotator::handleCustomAttributes(Decl *D) {
// If this attribute resolves to a macro, index that.
ASTContext &ctx = D->getASTContext();
ResolveMacroRequest req{const_cast<CustomAttr *>(customAttr),
D->getInnermostDeclContext()};
D->getDeclContext()};
if (auto macroDecl = evaluateOrDefault(ctx.evaluator, req, nullptr)) {
Type macroRefType = macroDecl->getDeclaredInterfaceType();
if (!passReference(