Skip to content

Commit d85781a

Browse files
authored
Fix handling of deleted and templated constructors. (#6129)
Don't ignore deleted constructors in overload resolution. If one is the best match, we want an error rather than picking something else. Don't crash if we find a constructor template or other weird thing; use `getConstructorInfo` to map it into a constructor and skip it if it isn't one, like Clang does.
1 parent 1fba60c commit d85781a

File tree

2 files changed

+240
-11
lines changed

2 files changed

+240
-11
lines changed

toolchain/check/cpp/import.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "clang/Frontend/TextDiagnostic.h"
2222
#include "clang/Lex/PreprocessorOptions.h"
2323
#include "clang/Sema/Lookup.h"
24+
#include "clang/Sema/Overload.h"
2425
#include "common/check.h"
2526
#include "common/ostream.h"
2627
#include "common/raw_string_ostream.h"
@@ -2117,12 +2118,12 @@ static auto ImportConstructorsIntoScope(Context& context, SemIR::LocId loc_id,
21172118
ClangConstructorLookup(context, scope_id);
21182119

21192120
clang::UnresolvedSet<4> overload_set;
2120-
for (clang::Decl* decl : constructors_lookup) {
2121-
auto* constructor = cast<clang::CXXConstructorDecl>(decl);
2122-
if (constructor->isDeleted() || constructor->isCopyOrMoveConstructor()) {
2121+
for (auto* decl : constructors_lookup) {
2122+
auto info = clang::getConstructorInfo(decl);
2123+
if (!info.Constructor || info.Constructor->isCopyOrMoveConstructor()) {
21232124
continue;
21242125
}
2125-
overload_set.addDecl(constructor, constructor->getAccess());
2126+
overload_set.addDecl(info.FoundDecl, info.FoundDecl->getAccess());
21262127
}
21272128
if (overload_set.empty()) {
21282129
return SemIR::ScopeLookupResult::MakeNotFound();

toolchain/check/testdata/interop/cpp/class/constructor.carbon

Lines changed: 235 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,28 +106,78 @@ fn F() {
106106
}
107107

108108
// ============================================================================
109-
// No constructors
109+
// Constructor templates
110110
// ============================================================================
111111

112-
// --- none.h
112+
// --- template.h
113+
114+
class C {
115+
public:
116+
C(int);
117+
template<typename T> C(T);
118+
};
119+
120+
// --- import_template.carbon
121+
122+
library "[[@TEST_NAME]]";
123+
124+
import Cpp library "template.h";
125+
126+
fn F() {
127+
//@dump-sem-ir-begin
128+
var c1: Cpp.C = Cpp.C.C(123);
129+
var c2: Cpp.C = Cpp.C.C(true);
130+
var c3: Cpp.C = Cpp.C.C(&c1);
131+
//@dump-sem-ir-end
132+
}
133+
134+
// ============================================================================
135+
// Deleted constructor
136+
// ============================================================================
137+
138+
// --- deleted.h
113139

114140
class C {
115141
public:
116142
C() = delete;
117143
};
118144

119-
// --- fail_import_none.carbon
145+
class D {
146+
public:
147+
D(int) = delete;
148+
D(short);
149+
};
150+
151+
// --- fail_import_deleted.carbon
120152

121153
library "[[@TEST_NAME]]";
122154

123-
import Cpp library "none.h";
155+
import Cpp library "deleted.h";
124156

125157
fn F() {
126-
// CHECK:STDERR: fail_import_none.carbon:[[@LINE+4]]:18: error: member name `C` not found in `Cpp.C` [MemberNameNotFoundInInstScope]
127-
// CHECK:STDERR: let c: Cpp.C = Cpp.C.C();
128-
// CHECK:STDERR: ^~~~~~~
158+
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+8]]:26: error: call to deleted function 'C' [CppInteropParseError]
159+
// CHECK:STDERR: 15 | let c: Cpp.C = Cpp.C.C();
160+
// CHECK:STDERR: | ^
161+
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
162+
// CHECK:STDERR: ./deleted.h:4:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
163+
// CHECK:STDERR: 4 | C() = delete;
164+
// CHECK:STDERR: | ^
129165
// CHECK:STDERR:
130166
let c: Cpp.C = Cpp.C.C();
167+
168+
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+12]]:27: error: call to deleted function 'D' [CppInteropParseError]
169+
// CHECK:STDERR: 29 | let d: Cpp.D = Cpp.D.D(0);
170+
// CHECK:STDERR: | ^
171+
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
172+
// CHECK:STDERR: ./deleted.h:9:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
173+
// CHECK:STDERR: 9 | D(int) = delete;
174+
// CHECK:STDERR: | ^
175+
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE-20]]:10: in file included here [InCppInclude]
176+
// CHECK:STDERR: ./deleted.h:10:3: note: candidate constructor [CppInteropParseNote]
177+
// CHECK:STDERR: 10 | D(short);
178+
// CHECK:STDERR: | ^
179+
// CHECK:STDERR:
180+
let d: Cpp.D = Cpp.D.D(0);
131181
}
132182

133183
// ============================================================================
@@ -646,6 +696,184 @@ fn F() {
646696
// CHECK:STDOUT: <elided>
647697
// CHECK:STDOUT: }
648698
// CHECK:STDOUT:
699+
// CHECK:STDOUT: --- import_template.carbon
700+
// CHECK:STDOUT:
701+
// CHECK:STDOUT: constants {
702+
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
703+
// CHECK:STDOUT: %C: type = class_type @C [concrete]
704+
// CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete]
705+
// CHECK:STDOUT: %.d40: type = cpp_overload_set_type @C.C.1 [concrete]
706+
// CHECK:STDOUT: %empty_struct: %.d40 = struct_value () [concrete]
707+
// CHECK:STDOUT: %int_123.fff: Core.IntLiteral = int_value 123 [concrete]
708+
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
709+
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
710+
// CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete]
711+
// CHECK:STDOUT: %C__carbon_thunk.type.65f120.1: type = fn_type @C__carbon_thunk.1 [concrete]
712+
// CHECK:STDOUT: %C__carbon_thunk.d98342.1: %C__carbon_thunk.type.65f120.1 = struct_value () [concrete]
713+
// CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
714+
// CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
715+
// CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
716+
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
717+
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
718+
// CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
719+
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
720+
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
721+
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
722+
// CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
723+
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
724+
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
725+
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_123.fff, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
726+
// CHECK:STDOUT: %int_123.f7f: %i32 = int_value 123 [concrete]
727+
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
728+
// CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
729+
// CHECK:STDOUT: %C__carbon_thunk.type.65f120.2: type = fn_type @C__carbon_thunk.2 [concrete]
730+
// CHECK:STDOUT: %C__carbon_thunk.d98342.2: %C__carbon_thunk.type.65f120.2 = struct_value () [concrete]
731+
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
732+
// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
733+
// CHECK:STDOUT: %Copy.impl_witness.a56: <witness> = impl_witness imports.%Copy.impl_witness_table.189 [concrete]
734+
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value bool, (%Copy.impl_witness.a56) [concrete]
735+
// CHECK:STDOUT: %.05c: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
736+
// CHECK:STDOUT: %bool.as.Copy.impl.Op.type: type = fn_type @bool.as.Copy.impl.Op [concrete]
737+
// CHECK:STDOUT: %bool.as.Copy.impl.Op: %bool.as.Copy.impl.Op.type = struct_value () [concrete]
738+
// CHECK:STDOUT: %bool.as.Copy.impl.Op.bound: <bound method> = bound_method %true, %bool.as.Copy.impl.Op [concrete]
739+
// CHECK:STDOUT: %C__carbon_thunk.type.65f120.3: type = fn_type @C__carbon_thunk.3 [concrete]
740+
// CHECK:STDOUT: %C__carbon_thunk.d98342.3: %C__carbon_thunk.type.65f120.3 = struct_value () [concrete]
741+
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanAggregateDestroy>> [concrete]
742+
// CHECK:STDOUT: %facet_value: %type_where = facet_value %C, () [concrete]
743+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.type.fc1: type = fn_type @AggregateT.as_type.as.Destroy.impl.Op, @AggregateT.as_type.as.Destroy.impl(%facet_value) [concrete]
744+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.6b9: %AggregateT.as_type.as.Destroy.impl.Op.type.fc1 = struct_value () [concrete]
745+
// CHECK:STDOUT: %bool.as.Destroy.impl.Op.type: type = fn_type @bool.as.Destroy.impl.Op [concrete]
746+
// CHECK:STDOUT: %bool.as.Destroy.impl.Op: %bool.as.Destroy.impl.Op.type = struct_value () [concrete]
747+
// CHECK:STDOUT: }
748+
// CHECK:STDOUT:
749+
// CHECK:STDOUT: imports {
750+
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
751+
// CHECK:STDOUT: .C = %C.decl
752+
// CHECK:STDOUT: import Cpp//...
753+
// CHECK:STDOUT: }
754+
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
755+
// CHECK:STDOUT: %.40b: %.d40 = cpp_overload_set_value @C.C.1 [concrete = constants.%empty_struct]
756+
// CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.1: %C__carbon_thunk.type.65f120.1 = fn_decl @C__carbon_thunk.1 [concrete = constants.%C__carbon_thunk.d98342.1] {
757+
// CHECK:STDOUT: <elided>
758+
// CHECK:STDOUT: } {
759+
// CHECK:STDOUT: <elided>
760+
// CHECK:STDOUT: }
761+
// CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = import_ref Core//prelude/parts/int, loc23_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
762+
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
763+
// CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.2: %C__carbon_thunk.type.65f120.2 = fn_decl @C__carbon_thunk.2 [concrete = constants.%C__carbon_thunk.d98342.2] {
764+
// CHECK:STDOUT: <elided>
765+
// CHECK:STDOUT: } {
766+
// CHECK:STDOUT: <elided>
767+
// CHECK:STDOUT: }
768+
// CHECK:STDOUT: %Core.import_ref.cc5: %bool.as.Copy.impl.Op.type = import_ref Core//prelude/parts/copy, loc20_31, loaded [concrete = constants.%bool.as.Copy.impl.Op]
769+
// CHECK:STDOUT: %Copy.impl_witness_table.189 = impl_witness_table (%Core.import_ref.cc5), @bool.as.Copy.impl [concrete]
770+
// CHECK:STDOUT: %C__carbon_thunk.decl.8acdfe.3: %C__carbon_thunk.type.65f120.3 = fn_decl @C__carbon_thunk.3 [concrete = constants.%C__carbon_thunk.d98342.3] {
771+
// CHECK:STDOUT: <elided>
772+
// CHECK:STDOUT: } {
773+
// CHECK:STDOUT: <elided>
774+
// CHECK:STDOUT: }
775+
// CHECK:STDOUT: }
776+
// CHECK:STDOUT:
777+
// CHECK:STDOUT: fn @F() {
778+
// CHECK:STDOUT: !entry:
779+
// CHECK:STDOUT: name_binding_decl {
780+
// CHECK:STDOUT: %c1.patt: %pattern_type.217 = binding_pattern c1 [concrete]
781+
// CHECK:STDOUT: %c1.var_patt: %pattern_type.217 = var_pattern %c1.patt [concrete]
782+
// CHECK:STDOUT: }
783+
// CHECK:STDOUT: %c1.var: ref %C = var %c1.var_patt
784+
// CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
785+
// CHECK:STDOUT: %C.ref.loc8_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
786+
// CHECK:STDOUT: %C.ref.loc8_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct]
787+
// CHECK:STDOUT: %int_123: Core.IntLiteral = int_value 123 [concrete = constants.%int_123.fff]
788+
// CHECK:STDOUT: %.loc8_3.1: ref %C = splice_block %c1.var {}
789+
// CHECK:STDOUT: %impl.elem0.loc8: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
790+
// CHECK:STDOUT: %bound_method.loc8_27.1: <bound method> = bound_method %int_123, %impl.elem0.loc8 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
791+
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0.loc8, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
792+
// CHECK:STDOUT: %bound_method.loc8_27.2: <bound method> = bound_method %int_123, %specific_fn [concrete = constants.%bound_method]
793+
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_27.2(%int_123) [concrete = constants.%int_123.f7f]
794+
// CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_123.f7f]
795+
// CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_123, %.loc8_27.1 [concrete = constants.%int_123.f7f]
796+
// CHECK:STDOUT: %addr.loc8_30: %ptr.d9e = addr_of %.loc8_3.1
797+
// CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %addr.loc8_30)
798+
// CHECK:STDOUT: %.loc8_30: init %C = in_place_init %C__carbon_thunk.call.loc8, %.loc8_3.1
799+
// CHECK:STDOUT: assign %c1.var, %.loc8_30
800+
// CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] {
801+
// CHECK:STDOUT: %Cpp.ref.loc8_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
802+
// CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
803+
// CHECK:STDOUT: }
804+
// CHECK:STDOUT: %c1: ref %C = bind_name c1, %c1.var
805+
// CHECK:STDOUT: name_binding_decl {
806+
// CHECK:STDOUT: %c2.patt: %pattern_type.217 = binding_pattern c2 [concrete]
807+
// CHECK:STDOUT: %c2.var_patt: %pattern_type.217 = var_pattern %c2.patt [concrete]
808+
// CHECK:STDOUT: }
809+
// CHECK:STDOUT: %c2.var: ref %C = var %c2.var_patt
810+
// CHECK:STDOUT: %Cpp.ref.loc9_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
811+
// CHECK:STDOUT: %C.ref.loc9_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
812+
// CHECK:STDOUT: %C.ref.loc9_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct]
813+
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
814+
// CHECK:STDOUT: %.loc9_3.1: ref %C = splice_block %c2.var {}
815+
// CHECK:STDOUT: %.loc9_27.1: ref bool = temporary_storage
816+
// CHECK:STDOUT: %impl.elem0.loc9: %.05c = impl_witness_access constants.%Copy.impl_witness.a56, element0 [concrete = constants.%bool.as.Copy.impl.Op]
817+
// CHECK:STDOUT: %bound_method.loc9_27: <bound method> = bound_method %true, %impl.elem0.loc9 [concrete = constants.%bool.as.Copy.impl.Op.bound]
818+
// CHECK:STDOUT: %bool.as.Copy.impl.Op.call: init bool = call %bound_method.loc9_27(%true) [concrete = constants.%true]
819+
// CHECK:STDOUT: %.loc9_27.2: ref bool = temporary %.loc9_27.1, %bool.as.Copy.impl.Op.call
820+
// CHECK:STDOUT: %addr.loc9_31.1: %ptr.bb2 = addr_of %.loc9_27.2
821+
// CHECK:STDOUT: %addr.loc9_31.2: %ptr.d9e = addr_of %.loc9_3.1
822+
// CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%addr.loc9_31.1, %addr.loc9_31.2)
823+
// CHECK:STDOUT: %.loc9_31: init %C = in_place_init %C__carbon_thunk.call.loc9, %.loc9_3.1
824+
// CHECK:STDOUT: assign %c2.var, %.loc9_31
825+
// CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] {
826+
// CHECK:STDOUT: %Cpp.ref.loc9_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
827+
// CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
828+
// CHECK:STDOUT: }
829+
// CHECK:STDOUT: %c2: ref %C = bind_name c2, %c2.var
830+
// CHECK:STDOUT: name_binding_decl {
831+
// CHECK:STDOUT: %c3.patt: %pattern_type.217 = binding_pattern c3 [concrete]
832+
// CHECK:STDOUT: %c3.var_patt: %pattern_type.217 = var_pattern %c3.patt [concrete]
833+
// CHECK:STDOUT: }
834+
// CHECK:STDOUT: %c3.var: ref %C = var %c3.var_patt
835+
// CHECK:STDOUT: %Cpp.ref.loc10_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
836+
// CHECK:STDOUT: %C.ref.loc10_22: type = name_ref C, imports.%C.decl [concrete = constants.%C]
837+
// CHECK:STDOUT: %C.ref.loc10_24: %.d40 = name_ref C, imports.%.40b [concrete = constants.%empty_struct]
838+
// CHECK:STDOUT: %c1.ref: ref %C = name_ref c1, %c1
839+
// CHECK:STDOUT: %addr.loc10_27: %ptr.d9e = addr_of %c1.ref
840+
// CHECK:STDOUT: %.loc10_3.1: ref %C = splice_block %c3.var {}
841+
// CHECK:STDOUT: %addr.loc10_30: %ptr.d9e = addr_of %.loc10_3.1
842+
// CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.3(%addr.loc10_27, %addr.loc10_30)
843+
// CHECK:STDOUT: %.loc10_30: init %C = in_place_init %C__carbon_thunk.call.loc10, %.loc10_3.1
844+
// CHECK:STDOUT: assign %c3.var, %.loc10_30
845+
// CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10_14 [concrete = constants.%C] {
846+
// CHECK:STDOUT: %Cpp.ref.loc10_11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
847+
// CHECK:STDOUT: %C.ref.loc10_14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
848+
// CHECK:STDOUT: }
849+
// CHECK:STDOUT: %c3: ref %C = bind_name c3, %c3.var
850+
// CHECK:STDOUT: %facet_value.loc10: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
851+
// CHECK:STDOUT: %.loc10_3.2: %type_where = converted constants.%C, %facet_value.loc10 [concrete = constants.%facet_value]
852+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %c3.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.6b9
853+
// CHECK:STDOUT: <elided>
854+
// CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %c3.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.1
855+
// CHECK:STDOUT: %addr.loc10_3: %ptr.d9e = addr_of %c3.var
856+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10_3)
857+
// CHECK:STDOUT: %bool.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc9_27.2, constants.%bool.as.Destroy.impl.Op
858+
// CHECK:STDOUT: %addr.loc9_27: %ptr.bb2 = addr_of %.loc9_27.2
859+
// CHECK:STDOUT: %bool.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bool.as.Destroy.impl.Op.bound(%addr.loc9_27)
860+
// CHECK:STDOUT: %facet_value.loc9: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
861+
// CHECK:STDOUT: %.loc9_3.2: %type_where = converted constants.%C, %facet_value.loc9 [concrete = constants.%facet_value]
862+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc9: <bound method> = bound_method %c2.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.6b9
863+
// CHECK:STDOUT: <elided>
864+
// CHECK:STDOUT: %bound_method.loc9_3: <bound method> = bound_method %c2.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.2
865+
// CHECK:STDOUT: %addr.loc9_3: %ptr.d9e = addr_of %c2.var
866+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc9: init %empty_tuple.type = call %bound_method.loc9_3(%addr.loc9_3)
867+
// CHECK:STDOUT: %facet_value.loc8: %type_where = facet_value constants.%C, () [concrete = constants.%facet_value]
868+
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%C, %facet_value.loc8 [concrete = constants.%facet_value]
869+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.bound.loc8: <bound method> = bound_method %c1.var, constants.%AggregateT.as_type.as.Destroy.impl.Op.6b9
870+
// CHECK:STDOUT: <elided>
871+
// CHECK:STDOUT: %bound_method.loc8_3: <bound method> = bound_method %c1.var, %AggregateT.as_type.as.Destroy.impl.Op.specific_fn.3
872+
// CHECK:STDOUT: %addr.loc8_3: %ptr.d9e = addr_of %c1.var
873+
// CHECK:STDOUT: %AggregateT.as_type.as.Destroy.impl.Op.call.loc8: init %empty_tuple.type = call %bound_method.loc8_3(%addr.loc8_3)
874+
// CHECK:STDOUT: <elided>
875+
// CHECK:STDOUT: }
876+
// CHECK:STDOUT:
649877
// CHECK:STDOUT: --- fail_todo_import_implicit_single_argument.carbon
650878
// CHECK:STDOUT:
651879
// CHECK:STDOUT: constants {

0 commit comments

Comments
 (0)