From bd7f89b1addeb8f10a050c446324f3d5d0b8bd39 Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Wed, 27 May 2026 08:57:03 +1000 Subject: [PATCH] Remove `lookup_result` and `function` (#7264) PR #7230 was automerged before https://github.com/carbon-language/carbon-lang/pull/7230#pullrequestreview-4348841410 could be applied. This commit actions that feedback. --- toolchain/check/cpp/impl_lookup.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/toolchain/check/cpp/impl_lookup.cpp b/toolchain/check/cpp/impl_lookup.cpp index ca4a250aeceb..95b12eb4a7da 100644 --- a/toolchain/check/cpp/impl_lookup.cpp +++ b/toolchain/check/cpp/impl_lookup.cpp @@ -417,15 +417,6 @@ static auto LookupCppUnqualified(Context& context, clang::Sema& clang_sema, clang::CXXRecordDecl* /*class_decl*/, SemIR::ConstantId query_self_const_id) -> SemIR::InstId { - auto lookup_result = clang_sema.CreateUnresolvedLookupExpr( - /*NamingClass=*/nullptr, clang::NestedNameSpecifierLoc(), name_info, - clang::UnresolvedSet<0>()); - if (lookup_result.isInvalid()) { - return SemIR::ErrorInst::InstId; - } - - auto* function = llvm::cast(lookup_result.get()); - auto candidate_set = clang::OverloadCandidateSet( clang::SourceLocation(), clang::OverloadCandidateSet::CandidateSetKind::CSK_Normal); @@ -466,7 +457,7 @@ static auto LookupCppUnqualified(Context& context, clang::Sema& clang_sema, auto decl_info = DeclInfo{ .decl = best_candidate->Function, .signature_id = ComputeClangDeclSignatureFromBestViableFunction( - context, best_candidate, function, args), + context, best_candidate, nullptr, args), }; return GetFunctionId(context, loc_id, decl_info); }