Skip to content

Commit 1bd6b2b

Browse files
committed
[Name lookup] Match macro introduced names based on their base names.
Some lookups, such as the ones used for protocol conformance checking, provide full names (with arguments). Drop everything down to simple names so they we don't skip macro expansions when we might need them. (cherry picked from commit 706b3e1)
1 parent 7e87880 commit 1bd6b2b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/AST/NameLookup.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,11 +1601,12 @@ namespace {
16011601
macro->getIntroducedNames(
16021602
attr->getMacroRole(), attachedTo, introducedNames);
16031603
for (auto name : introducedNames)
1604-
allIntroducedNames.insert(name);
1604+
allIntroducedNames.insert(name.getBaseName());
16051605
}
16061606

16071607
bool shouldExpandForName(DeclName name) const {
1608-
return introducesArbitraryNames || allIntroducedNames.contains(name);
1608+
return introducesArbitraryNames ||
1609+
allIntroducedNames.contains(name.getBaseName());
16091610
}
16101611
};
16111612
}

0 commit comments

Comments
 (0)