We must pass the primary decl context to Sema's LookupQualifiedName [ROOT-7737].

This is guarded by an assert in Sema::LookupQualifiedName.
This commit is contained in:
Philippe Canal 2015-10-15 14:27:07 -05:00 committed by sftnight
parent fdbc4b985c
commit 32bd423d59

View File

@ -1352,13 +1352,12 @@ namespace utils {
if (!Within)
S->LookupName(R, S->TUScope);
else {
if (const clang::TagDecl* TD = dyn_cast<clang::TagDecl>(Within)) {
if (!TD->getDefinition()) {
// No definition, no lookup result.
return 0;
}
auto primaryWithin = Within->getPrimaryContext();
if (!primaryWithin) {
// No definition, no lookup result.
return 0;
}
S->LookupQualifiedName(R, const_cast<DeclContext*>(Within));
S->LookupQualifiedName(R, const_cast<DeclContext*>(primaryWithin));
}
if (R.empty())