mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 10:25:49 +01:00
Refactor LookupCopyImpl and LookupDestroyImpl to share logic. (#6649)
Assisted-by: Google Antigravity with Gemini 3 Flash
This commit is contained in:
@@ -262,12 +262,10 @@ auto LookupCppOperator(Context& context, SemIR::LocId loc_id, Operator op,
|
||||
// If this is an operator method, the first arg will be used as self.
|
||||
arg_ids.size() -
|
||||
(isa<clang::CXXMethodDecl>(best_viable_fn->Function) ? 1 : 0));
|
||||
if (auto fn_decl =
|
||||
context.insts().TryGetAsWithId<SemIR::FunctionDecl>(result_id)) {
|
||||
CheckCppOverloadAccess(context, loc_id, best_viable_fn->FoundDecl,
|
||||
fn_decl->inst_id);
|
||||
} else {
|
||||
CARBON_CHECK(result_id == SemIR::ErrorInst::InstId);
|
||||
if (result_id != SemIR::ErrorInst::InstId) {
|
||||
CheckCppOverloadAccess(
|
||||
context, loc_id, best_viable_fn->FoundDecl,
|
||||
context.insts().GetAsKnownInstId<SemIR::FunctionDecl>(result_id));
|
||||
}
|
||||
return result_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user