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:
Boaz Brickner
2025-03-24 17:27:20 +00:00
committed by GitHub
parent b3c7a7e988
commit 44bcceba86
+5 -5
View File
@@ -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 "