mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:10:13 +01:00
When import C++ names, add the note on the ClangLookup() as well (#5142)
Currently has no effect because we can't do lookup in classes, yet. Part of #4666.
This commit is contained in:
@@ -348,11 +348,6 @@ static auto ImportNameDecl(Context& context, SemIR::LocId loc_id,
|
||||
auto ImportNameFromCpp(Context& context, SemIR::LocId loc_id,
|
||||
SemIR::NameScopeId scope_id, SemIR::NameId name_id)
|
||||
-> SemIR::InstId {
|
||||
auto lookup = ClangLookup(context, loc_id, scope_id, name_id);
|
||||
if (!lookup) {
|
||||
return SemIR::InstId::None;
|
||||
}
|
||||
|
||||
DiagnosticAnnotationScope annotate_diagnostics(
|
||||
&context.emitter(), [&](auto& builder) {
|
||||
CARBON_DIAGNOSTIC(InCppNameLookup, Note,
|
||||
@@ -360,6 +355,11 @@ auto ImportNameFromCpp(Context& context, SemIR::LocId loc_id,
|
||||
builder.Note(loc_id, InCppNameLookup, name_id);
|
||||
});
|
||||
|
||||
auto lookup = ClangLookup(context, loc_id, scope_id, name_id);
|
||||
if (!lookup) {
|
||||
return SemIR::InstId::None;
|
||||
}
|
||||
|
||||
if (!lookup->isSingleResult()) {
|
||||
context.TODO(loc_id,
|
||||
llvm::formatv("Unsupported: Lookup succeeded but couldn't "
|
||||
|
||||
Reference in New Issue
Block a user