Skip to content

Commit

Permalink
[cling] Make cling::utils::Lookup::Named look into using directives
Browse files Browse the repository at this point in the history
  • Loading branch information
devajithvs committed May 8, 2024
1 parent 37f978c commit 0ed2a1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion interpreter/cling/lib/Utils/AST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,15 @@ namespace utils {
// No definition, no lookup result.
return;
}
S->LookupQualifiedName(R, const_cast<DeclContext*>(primaryWithin));
auto res =
S->LookupQualifiedName(R, const_cast<DeclContext*>(primaryWithin));

// If the lookup fails and the context is a namespace, try to lookup in
// the namespaces brought in by using directives.
if (!res && primaryWithin->isNamespace())
for (auto* UD : primaryWithin->using_directives())
if (NamespaceDecl* NS = UD->getNominatedNamespace())
res = S->LookupQualifiedName(R, NS);
}
}

Expand Down

0 comments on commit 0ed2a1c

Please sign in to comment.