mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 04:38:13 +00:00
Switch tests to use the rendered form of diagnostics (#8070)
Historically, we disabled the rendered form in tests outside of `toolchain/diagnostics`. The idea was to keep tests shorter and avoid very long chains of autoupdate before stabilizing due to all the line numbers and other artifacts in the rendered form. This PR adds `--diagnostic-line-numbers=[all|first]` and defaults to `first` in tests. This keeps the rendered form so that we can easily code review that form and the visual cues it does or doesn't provide. But it removes all but the first location's line numbers to provide significantly more stability in tests. By default, tests get the full unicode line-drawing form of diagnostics so we can ensure all of the artifacts there make sense with the specific case being diagnosed, but we do retain some focused ASCII-rendering tests to ensure that fallback remains usable. There are some issues here that will be fixed in subsequent PRs. Notably, we try to keep the frame together in the check lines, and so force some parts to use the first location. This largely works, but fails in some edge cases, causing the entire frame to be located incorrectly. There is a TODO about this that we need to fix, and it only occurs 6 times across the test suite, so it didn't seem worth front-loading a fix for here. Assisted-by: Claude Code
This commit is contained in:
1 parent
0b7059a360
commit
d0badecd2a
888 files changed
+39731
-12799
No files matched your search
+30
-19
@@ -112,8 +112,19 @@ import Cpp library "conversions.h";
|
||||
|
||||
fn ConstructorExplicit(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_conditionally_explicit_implicit.carbon:[[@LINE+3]]:42: error: cannot implicitly convert expression of type `Source` to `Cpp.ConditionallyExplicit` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_conditionally_explicit_implicit.carbon:[[@LINE+2]]:42: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.ConditionallyExplicit)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_conditionally_explicit_implicit.carbon:[[@LINE+14]]:42
|
||||
// CHECK:STDERR: -> │ let _: Cpp.ConditionallyExplicitTrue = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert
|
||||
// CHECK:STDERR: · │ ┃ expression of type `Source`
|
||||
// CHECK:STDERR: · │ ┃ to
|
||||
// CHECK:STDERR: · │ ┃ `Cpp.ConditionallyExplicit`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╭────────────────────────────────────────╯
|
||||
// CHECK:STDERR: · │ type `Cpp.Source` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ConditionallyExplicit)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.ConditionallyExplicitTrue = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -560,9 +571,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) {
|
||||
// CHECK:STDOUT: fn @ConstructorExplicit(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc11_42: %ConditionallyExplicit.9d4 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %ConditionallyExplicitTrue.ref [concrete = constants.%ConditionallyExplicit.9d4] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc22_42: %ConditionallyExplicit.9d4 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc22_13: type = splice_block %ConditionallyExplicitTrue.ref [concrete = constants.%ConditionallyExplicit.9d4] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ConditionallyExplicitTrue.ref: type = name_ref ConditionallyExplicitTrue, imports.%ConditionallyExplicit.decl.6ab [concrete = constants.%ConditionallyExplicit.9d4]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %ConditionallyExplicit.9d4 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -575,27 +586,27 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) {
|
||||
// CHECK:STDOUT: fn @ConversionExplicit(%s.param: %ConditionallyExplicit.3cd) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %ConditionallyExplicit.3cd = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc17_21.1: ref %Dest.980 = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc17_21.1
|
||||
// CHECK:STDOUT: %.loc28_21.1: ref %Dest.980 = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc28_21.1
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr)
|
||||
// CHECK:STDOUT: %.loc17_21.2: init %Dest.980 to %.loc17_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc17_21.3: init %Dest.980 = converted %s.ref, %.loc17_21.2
|
||||
// CHECK:STDOUT: %.loc17_21.4: ref %Dest.980 = temporary %.loc17_21.1, %.loc17_21.3
|
||||
// CHECK:STDOUT: %.loc17_21.5: %Dest.980 = acquire_value %.loc17_21.4
|
||||
// CHECK:STDOUT: %.loc17_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc28_21.2: init %Dest.980 to %.loc28_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc28_21.3: init %Dest.980 = converted %s.ref, %.loc28_21.2
|
||||
// CHECK:STDOUT: %.loc28_21.4: ref %Dest.980 = temporary %.loc28_21.1, %.loc28_21.3
|
||||
// CHECK:STDOUT: %.loc28_21.5: %Dest.980 = acquire_value %.loc28_21.4
|
||||
// CHECK:STDOUT: %.loc28_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, %.loc17_21.5
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, %.loc28_21.5
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_21.1: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc17_21.6: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc17_21.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_21.2: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc17_21.7: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc17_21.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc28_21.1: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc28_21.6: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc28_21.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc28_21.2: %Destroy.type = facet_value constants.%Dest.980, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc28_21.7: %Destroy.type = converted constants.%Dest.980, %Destroy.facet.loc28_21.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_21.4)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc28_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+76
-14
@@ -83,54 +83,116 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "types.h";
|
||||
|
||||
fn CopyDeletedCopy(c: Cpp.DeletedCopy) -> Cpp.DeletedCopy {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:14:3: note: 'DeletedCopy' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+12]]:10
|
||||
// CHECK:STDERR: -> │ return c;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ DeletedCopy(const DeletedCopy&) = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ 'DeletedCopy' has been explicitly marked deleted here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyMoveOnly(c: Cpp.MoveOnly) -> Cpp.MoveOnly {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:19:3: note: copy constructor is implicitly deleted because 'MoveOnly' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+13]]:10
|
||||
// CHECK:STDERR: -> │ return c;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ MoveOnly(MoveOnly&&);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ copy constructor is implicitly deleted because 'MoveOnly' has a
|
||||
// CHECK:STDERR: · │ user-declared move constructor
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyDeletedMove(c: Cpp.DeletedMove) -> Cpp.DeletedMove {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:24:3: note: copy constructor is implicitly deleted because 'DeletedMove' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+13]]:10
|
||||
// CHECK:STDERR: -> │ return c;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ DeletedMove(DeletedMove&&) = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ copy constructor is implicitly deleted because 'DeletedMove' has a
|
||||
// CHECK:STDERR: · │ user-declared move constructor
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyNonConstCopy(c: Cpp.NonConstCopy) -> Cpp.NonConstCopy {
|
||||
// TODO: List candidates here.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot copy value of type `NonConstCopy` [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+2]]:10: note: type `Cpp.NonConstCopy` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+9]]:10
|
||||
// CHECK:STDERR: -> │ return c;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `NonConstCopy`
|
||||
// CHECK:STDERR: · │ ┃ [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.NonConstCopy` does not implement interface `Core.Copy`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyAmbiguousCopy(c: Cpp.AmbiguousCopy) -> Cpp.AmbiguousCopy {
|
||||
// TODO: List candidates here.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot copy value of type `AmbiguousCopy` [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+2]]:10: note: type `Cpp.AmbiguousCopy` does not implement interface `Core.Copy` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+10]]:10
|
||||
// CHECK:STDERR: -> │ return c;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot copy value of type `AmbiguousCopy`
|
||||
// CHECK:STDERR: · │ ┃ [CopyOfUncopyableType]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.AmbiguousCopy` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.Copy`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyPrivateCopy(c: Cpp.PrivateCopy) -> Cpp.PrivateCopy {
|
||||
// TODO: Note is missing location.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot access private member `PrivateCopy` of type `Cpp.PrivateCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:40:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+13]]:10
|
||||
// CHECK:STDERR: -> │ return c;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access private member `PrivateCopy` of type
|
||||
// CHECK:STDERR: · ┃ `Cpp.PrivateCopy`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ PrivateCopy(const PrivateCopy&);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyProtectedCopy(c: Cpp.ProtectedCopy) -> Cpp.ProtectedCopy {
|
||||
// TODO: Note is missing location.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot access protected member `ProtectedCopy` of type `Cpp.ProtectedCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:45:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╭─┤ fail_copy_noncopyable.carbon:[[@LINE+13]]:10
|
||||
// CHECK:STDERR: -> │ return c;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access protected member `ProtectedCopy` of type
|
||||
// CHECK:STDERR: · ┃ `Cpp.ProtectedCopy`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ ProtectedCopy(const ProtectedCopy&);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -148,16 +148,50 @@ namespace N {
|
||||
class MutableRange {
|
||||
struct Iterator {};
|
||||
public:
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+4]]:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+22]]:15
|
||||
// CHECK:STDERR: -> │ friend auto begin(MutableRange&) -> Iterator;
|
||||
// CHECK:STDERR: · ┳ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━┫ error: value expression passed to
|
||||
// CHECK:STDERR: · │ ┃ reference parameter
|
||||
// CHECK:STDERR: · │ ┃ [ValueForRefParam]
|
||||
// CHECK:STDERR: · ╰────┤ initializing function parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn Begin(self) -> Iterator;
|
||||
// CHECK:STDERR: · ─────────────┬─────────────
|
||||
// CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function
|
||||
// CHECK:STDERR: · │ [ThunkSignature]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: · ┬──────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `R` declared
|
||||
// CHECK:STDERR: · │ here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
friend auto begin(MutableRange&) -> Iterator;
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+4]]:32: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_adl_returns_same_types_mutable.carbon:[[@LINE+22]]:15
|
||||
// CHECK:STDERR: -> │ friend auto end(MutableRange&) -> Iterator;
|
||||
// CHECK:STDERR: · ┳ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━┫ error: value expression passed to reference
|
||||
// CHECK:STDERR: · │ ┃ parameter
|
||||
// CHECK:STDERR: · │ ┃ [ValueForRefParam]
|
||||
// CHECK:STDERR: · ╰────┤ initializing function parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn End(self) -> Sentinel;
|
||||
// CHECK:STDERR: · ────────────┬────────────
|
||||
// CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function
|
||||
// CHECK:STDERR: · │ [ThunkSignature]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: · ┬──────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `R` declared
|
||||
// CHECK:STDERR: · │ here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
friend auto end(MutableRange&) -> Iterator;
|
||||
};
|
||||
@@ -198,7 +232,12 @@ import Cpp inline '''c++
|
||||
namespace N {
|
||||
class MutableRangeWithSentinel {
|
||||
struct Iterator {
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+2]]:31: error: unknown type name 'ValueType' [CppInteropParseError]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+7]]:31
|
||||
// CHECK:STDERR: -> │ auto operator*() const -> ValueType&;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: unknown type name 'ValueType'
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
auto operator*() const -> ValueType&;
|
||||
auto operator++() -> Iterator&;
|
||||
@@ -209,16 +248,52 @@ class MutableRangeWithSentinel {
|
||||
friend auto operator!=(Sentinel, Iterator) -> bool;
|
||||
};
|
||||
public:
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+4]]:46: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+23]]:15
|
||||
// CHECK:STDERR: -> │ friend auto begin(MutableRangeWithSentinel&) -> Iterator;
|
||||
// CHECK:STDERR: · ┳ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: value expression passed
|
||||
// CHECK:STDERR: · │ ┃ to reference parameter
|
||||
// CHECK:STDERR: · │ ┃ [ValueForRefParam]
|
||||
// CHECK:STDERR: · ╰────┤ initializing function
|
||||
// CHECK:STDERR: · │ parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn Begin(self) -> Iterator;
|
||||
// CHECK:STDERR: · ─────────────┬─────────────
|
||||
// CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function
|
||||
// CHECK:STDERR: · │ [ThunkSignature]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: · ┬──────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `R` declared
|
||||
// CHECK:STDERR: · │ here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
friend auto begin(MutableRangeWithSentinel&) -> Iterator;
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+4]]:44: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_adl_returns_different_types_mutable.carbon:[[@LINE+23]]:15
|
||||
// CHECK:STDERR: -> │ friend auto end(MutableRangeWithSentinel&) -> Sentinel;
|
||||
// CHECK:STDERR: · ┳ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: value expression passed
|
||||
// CHECK:STDERR: · │ ┃ to reference parameter
|
||||
// CHECK:STDERR: · │ ┃ [ValueForRefParam]
|
||||
// CHECK:STDERR: · ╰────┤ initializing function
|
||||
// CHECK:STDERR: · │ parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn End(self) -> Sentinel;
|
||||
// CHECK:STDERR: · ────────────┬────────────
|
||||
// CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function
|
||||
// CHECK:STDERR: · │ [ThunkSignature]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: · ┬──────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `R` declared
|
||||
// CHECK:STDERR: · │ here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
friend auto end(MutableRangeWithSentinel&) -> Sentinel;
|
||||
};
|
||||
@@ -240,16 +315,50 @@ class MutableAndConstRange {
|
||||
struct Iterator {};
|
||||
struct ConstIterator {};
|
||||
public:
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+4]]:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:10:3-29: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_adl_overloads.carbon:[[@LINE+22]]:15
|
||||
// CHECK:STDERR: -> │ friend auto begin(MutableAndConstRange&) -> Iterator;
|
||||
// CHECK:STDERR: · ┳ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: value expression passed to
|
||||
// CHECK:STDERR: · │ ┃ reference parameter
|
||||
// CHECK:STDERR: · │ ┃ [ValueForRefParam]
|
||||
// CHECK:STDERR: · ╰────┤ initializing function parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn Begin(self) -> Iterator;
|
||||
// CHECK:STDERR: · ─────────────┬─────────────
|
||||
// CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function
|
||||
// CHECK:STDERR: · │ [ThunkSignature]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: · ┬──────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `R` declared
|
||||
// CHECK:STDERR: · │ here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
friend auto begin(MutableAndConstRange&) -> Iterator;
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+5]]:15: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: fail_todo_adl_overloads.carbon:[[@LINE+4]]:40: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:11:3-27: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:21:33-63: note: initializing generic parameter `R` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_adl_overloads.carbon:[[@LINE+22]]:15
|
||||
// CHECK:STDERR: -> │ friend auto end(MutableAndConstRange&) -> Iterator;
|
||||
// CHECK:STDERR: · ┳ ┬
|
||||
// CHECK:STDERR: · ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ error: value expression passed to
|
||||
// CHECK:STDERR: · │ ┃ reference parameter
|
||||
// CHECK:STDERR: · │ ┃ [ValueForRefParam]
|
||||
// CHECK:STDERR: · ╰────┤ initializing function parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn End(self) -> Sentinel;
|
||||
// CHECK:STDERR: · ────────────┬────────────
|
||||
// CHECK:STDERR: · ╰──┤ while building thunk to match the signature of this function
|
||||
// CHECK:STDERR: · │ [ThunkSignature]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ fn AssertIsRange(unused generic R: IsRange where .Result = true) {}
|
||||
// CHECK:STDERR: · ┬──────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `R` declared
|
||||
// CHECK:STDERR: · │ here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
friend auto end(MutableAndConstRange&) -> Iterator;
|
||||
|
||||
@@ -348,24 +457,87 @@ struct EndFunctionDeleted {
|
||||
''';
|
||||
|
||||
fn Test() {
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:47: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-22]]:8: note: 'begin' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+20]]:47
|
||||
// CHECK:STDERR: │ auto begin() = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ 'begin' has been explicitly marked deleted here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ Core.AssertIsNotRange(Cpp.BeginMethodDeleted);
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: attempt to use a
|
||||
// CHECK:STDERR: · ┃ deleted function
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: · ┬───────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `S`
|
||||
// CHECK:STDERR: · │ declared here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.BeginMethodDeleted);
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:45: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-21]]:8: note: 'end' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+19]]:45
|
||||
// CHECK:STDERR: │ auto end() = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ 'end' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ Core.AssertIsNotRange(Cpp.EndMethodDeleted);
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: attempt to use a deleted
|
||||
// CHECK:STDERR: · ┃ function
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: · ┬───────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `S`
|
||||
// CHECK:STDERR: · │ declared here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.EndMethodDeleted);
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:49: error: call to deleted function 'begin' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-22]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+20]]:49
|
||||
// CHECK:STDERR: │ friend auto begin(const BeginFunctionDeleted&) = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ candidate function has been explicitly deleted
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ Core.AssertIsNotRange(Cpp.BeginFunctionDeleted);
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: call to deleted
|
||||
// CHECK:STDERR: · ┃ function 'begin'
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: · ┬───────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `S`
|
||||
// CHECK:STDERR: · │ declared here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.BeginFunctionDeleted);
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+4]]:47: error: call to deleted function 'end' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-21]]:15: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: cpp_range_for_iterate.carbon:22:36-67: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+20]]:47
|
||||
// CHECK:STDERR: │ friend auto end(const EndFunctionDeleted&) = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ candidate function has been explicitly deleted
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> │ Core.AssertIsNotRange(Cpp.EndFunctionDeleted);
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: call to deleted
|
||||
// CHECK:STDERR: · ┃ function 'end'
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ cpp_range_for_iterate.carbon
|
||||
// CHECK:STDERR: │ fn AssertIsNotRange(unused generic S: IsRange where .Result = false) {}
|
||||
// CHECK:STDERR: · ┬───────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing generic parameter `S`
|
||||
// CHECK:STDERR: · │ declared here
|
||||
// CHECK:STDERR: · │ [InitializingGenericParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Core.AssertIsNotRange(Cpp.EndFunctionDeleted);
|
||||
}
|
||||
+199
-82
@@ -77,9 +77,24 @@ class Derived {
|
||||
|
||||
fn DestroyClassWithProtectedBaseDestructor() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE+4]]:3-23: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_destroy_protected_base_destructor.carbon:[[@LINE+19]]:3
|
||||
// CHECK:STDERR: -> │ var unused a: Derived = {.base = {}};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access protected member `<C++ destructor>` of type
|
||||
// CHECK:STDERR: · ┃ `Cpp.ProtectedDestructor`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ ~ProtectedDestructor();
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon
|
||||
// CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) {
|
||||
// CHECK:STDERR: · ───────────────────┬───────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var unused a: Derived = {.base = {}};
|
||||
//@dump-sem-ir-end
|
||||
@@ -98,9 +113,24 @@ class Derived {
|
||||
fn DestroyClassWithPrivateBaseDestructor() {
|
||||
//@dump-sem-ir-begin
|
||||
// TODO: We should not allow this, as the destructor of the base class is private.
|
||||
// CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE+4]]:3-23: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_destroy_private_base_destructor.carbon:[[@LINE+19]]:3
|
||||
// CHECK:STDERR: -> │ var unused a: Derived = {.base = {}};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access private member `<C++ destructor>` of type
|
||||
// CHECK:STDERR: · ┃ `Cpp.PrivateDestructor`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ ~PrivateDestructor();
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon
|
||||
// CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) {
|
||||
// CHECK:STDERR: · ───────────────────┬───────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var unused a: Derived = {.base = {}};
|
||||
//@dump-sem-ir-end
|
||||
@@ -113,39 +143,112 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "types.h";
|
||||
|
||||
fn AmbiguousDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+7]]:17-39: error: binding pattern has incomplete type `AmbiguousDestructor` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./types.h:13:7: note: destructor of class 'AmbiguousDestructorT<>' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:13:7: note: in instantiation of template class 'AmbiguousDestructorT<>' requested here [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./types.h:15:3: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./types.h:16:3: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╭─┤ fail_destroy_nondestroyable.carbon:[[@LINE+25]]:17
|
||||
// CHECK:STDERR: -> │ var unused a: Cpp.AmbiguousDestructor = {};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: binding pattern has incomplete type
|
||||
// CHECK:STDERR: · ┃ `AmbiguousDestructor` in name binding declaration
|
||||
// CHECK:STDERR: · ┃ [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: │ ╭── included from: fail_destroy_nondestroyable.carbon [InCppInclude]
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ class AmbiguousDestructorT {
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ in instantiation of template class 'AmbiguousDestructorT<>' requested
|
||||
// CHECK:STDERR: · │ │ here
|
||||
// CHECK:STDERR: · │ │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: · ╰────┤ destructor of class 'AmbiguousDestructorT<>' is ambiguous
|
||||
// CHECK:STDERR: · │ [CppInteropParseError]
|
||||
// CHECK:STDERR: │ public:
|
||||
// CHECK:STDERR: │ ~AmbiguousDestructorT() requires (N != 1);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: │ ~AmbiguousDestructorT() requires (N != 2);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.AmbiguousDestructor = {};
|
||||
}
|
||||
|
||||
fn DeletedDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+7]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_destroy_nondestroyable.carbon:[[@LINE+32]]:3
|
||||
// CHECK:STDERR: -> │ var unused a: Cpp.DeletedDestructor = {};
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ ~DeletedDestructor() = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ '~DeletedDestructor' has been explicitly marked deleted here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon
|
||||
// CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) {
|
||||
// CHECK:STDERR: · ───────────────────┬───────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+3]]:3-37: error: cannot convert type `Cpp.DeletedDestructor` into type implementing `Core.Destroy` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_destroy_nondestroyable.carbon:[[@LINE+14]]:3
|
||||
// CHECK:STDERR: -> │ var unused a: Cpp.DeletedDestructor = {};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot convert type `Cpp.DeletedDestructor` into type implementing
|
||||
// CHECK:STDERR: · ┃ `Core.Destroy`
|
||||
// CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon
|
||||
// CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) {
|
||||
// CHECK:STDERR: · ───────────────────┬───────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.DeletedDestructor = {};
|
||||
}
|
||||
|
||||
fn PrivateDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:3-37: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_destroy_nondestroyable.carbon:[[@LINE+19]]:3
|
||||
// CHECK:STDERR: -> │ var unused a: Cpp.PrivateDestructor = {};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access private member `<C++ destructor>` of type
|
||||
// CHECK:STDERR: · ┃ `Cpp.PrivateDestructor`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ ~PrivateDestructor();
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon
|
||||
// CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) {
|
||||
// CHECK:STDERR: · ───────────────────┬───────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.PrivateDestructor = {};
|
||||
}
|
||||
|
||||
fn ProtectedDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:3-39: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_destroy_nondestroyable.carbon:[[@LINE+19]]:3
|
||||
// CHECK:STDERR: -> │ var unused a: Cpp.ProtectedDestructor = {};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access protected member `<C++ destructor>` of type
|
||||
// CHECK:STDERR: · ┃ `Cpp.ProtectedDestructor`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ ~ProtectedDestructor();
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon
|
||||
// CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) {
|
||||
// CHECK:STDERR: · ───────────────────┬───────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var unused a: Cpp.ProtectedDestructor = {};
|
||||
}
|
||||
@@ -183,9 +286,23 @@ class AdaptNoDestroy {
|
||||
fn Make() -> AdaptNoDestroy;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_no_destroy.carbon:[[@LINE+4]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╭─┤ fail_no_destroy.carbon:[[@LINE+18]]:3
|
||||
// CHECK:STDERR: -> │ var _: AdaptNoDestroy = Make();
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./types.h
|
||||
// CHECK:STDERR: │ ~DeletedDestructor() = delete;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ '~DeletedDestructor' has been explicitly marked deleted here
|
||||
// CHECK:STDERR: · │ [CppInteropParseNote]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ min_prelude/parts/destroy.carbon
|
||||
// CHECK:STDERR: │ fn SelfDestruct[T: Destroy](ref t: T) {
|
||||
// CHECK:STDERR: · ───────────────────┬───────────────────
|
||||
// CHECK:STDERR: · ╰──┤ while deducing parameters of generic declared here
|
||||
// CHECK:STDERR: · │ [DeductionGenericHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var _: AdaptNoDestroy = Make();
|
||||
}
|
||||
@@ -396,7 +513,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.e5d: %SubobjectDestroy.type = facet_value %ProtectedDestructor, (%custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %DestroyImpl.impl_witness.721: <witness> = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.e5d) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.fe4: %Destroy.type = facet_value %ProtectedDestructor, (%DestroyImpl.impl_witness.721, %custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc31_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.b80ef6.2: <witness> = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.1fc: %SubobjectDestroy.type = facet_value %Derived, (%custom_witness.b80ef6.2) [concrete]
|
||||
@@ -412,52 +529,52 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @DestroyClassWithProtectedBaseDestructor() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.var: ref %Derived = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %.loc16_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc16_38.1: %struct_type.base.f5e = struct_literal (%.loc16_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc16_38.2: ref %.a6c = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc16_37.2: init %.a6c to %.loc16_38.2 = class_init () [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc16_38.3: init %.a6c = converted %.loc16_37.1, %.loc16_37.2 [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc16_38.4: init %ProtectedDestructor = as_compatible %.loc16_38.3 [concrete = constants.%ProtectedDestructor.val]
|
||||
// CHECK:STDOUT: %.loc16_38.5: init %Derived to %a.var = class_init (%.loc16_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc16_3.1: init %Derived = converted %.loc16_38.1, %.loc16_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc16_3.1
|
||||
// CHECK:STDOUT: %.loc31_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc31_38.1: %struct_type.base.f5e = struct_literal (%.loc31_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc31_38.2: ref %.a6c = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc31_37.2: init %.a6c to %.loc31_38.2 = class_init () [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc31_38.3: init %.a6c = converted %.loc31_37.1, %.loc31_37.2 [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc31_38.4: init %ProtectedDestructor = as_compatible %.loc31_38.3 [concrete = constants.%ProtectedDestructor.val]
|
||||
// CHECK:STDOUT: %.loc31_38.5: init %Derived to %a.var = class_init (%.loc31_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc31_3.1: init %Derived = converted %.loc31_38.1, %.loc31_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc31_3.1
|
||||
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
|
||||
// CHECK:STDOUT: %a: ref %Derived = wrapper_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.746 = ref_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.746 = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc31_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc31_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc31_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc31_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc31_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc31_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%a.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc16_3.1(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc31_3.1(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %ProtectedDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc31_3.1: ref %ProtectedDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc31_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc31_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc31_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc31_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc31_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc31_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc16_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc31_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc16_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc31_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %base.ref: %Derived.elem = name_ref base, @Derived.%.loc7 [concrete = @Derived.%.loc7]
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %ProtectedDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc31_3.1: ref %ProtectedDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc31_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc31_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc31_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc31_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc31_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc31_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc16_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc31_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -492,7 +609,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.be1: %SubobjectDestroy.type = facet_value %PrivateDestructor, (%custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %DestroyImpl.impl_witness.a8a: <witness> = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.be1) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.75a: %Destroy.type = facet_value %PrivateDestructor, (%DestroyImpl.impl_witness.a8a, %custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc17_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc32_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.b80ef6.2: <witness> = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.1fc: %SubobjectDestroy.type = facet_value %Derived, (%custom_witness.b80ef6.2) [concrete]
|
||||
@@ -508,52 +625,52 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @DestroyClassWithPrivateBaseDestructor() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.var: ref %Derived = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %.loc17_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc17_38.1: %struct_type.base.f5e = struct_literal (%.loc17_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc17_38.2: ref %.c73 = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc17_37.2: init %.c73 to %.loc17_38.2 = class_init () [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc17_38.3: init %.c73 = converted %.loc17_37.1, %.loc17_37.2 [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc17_38.4: init %PrivateDestructor = as_compatible %.loc17_38.3 [concrete = constants.%PrivateDestructor.val]
|
||||
// CHECK:STDOUT: %.loc17_38.5: init %Derived to %a.var = class_init (%.loc17_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc17_3.1: init %Derived = converted %.loc17_38.1, %.loc17_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc17_3.1
|
||||
// CHECK:STDOUT: %.loc32_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc32_38.1: %struct_type.base.f5e = struct_literal (%.loc32_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc32_38.2: ref %.c73 = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc32_37.2: init %.c73 to %.loc32_38.2 = class_init () [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc32_38.3: init %.c73 = converted %.loc32_37.1, %.loc32_37.2 [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc32_38.4: init %PrivateDestructor = as_compatible %.loc32_38.3 [concrete = constants.%PrivateDestructor.val]
|
||||
// CHECK:STDOUT: %.loc32_38.5: init %Derived to %a.var = class_init (%.loc32_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc32_3.1: init %Derived = converted %.loc32_38.1, %.loc32_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc32_3.1
|
||||
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
|
||||
// CHECK:STDOUT: %a: ref %Derived = wrapper_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.746 = ref_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.746 = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc32_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc32_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc32_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc32_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%a.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.1(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc32_3.1(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc17_3.1: ref %PrivateDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc32_3.1: ref %PrivateDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc32_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc32_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc32_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc32_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %base.ref: %Derived.elem = name_ref base, @Derived.%.loc7 [concrete = @Derived.%.loc7]
|
||||
// CHECK:STDOUT: %.loc17_3.1: ref %PrivateDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc32_3.1: ref %PrivateDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc32_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc32_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc32_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc32_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+331
-170
@@ -92,8 +92,16 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn NonConstConversionTest(s: Cpp.NonConstConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_expr_category.carbon:[[@LINE+3]]:21: error: cannot implicitly convert expression of type `NonConstConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_expr_category.carbon:[[@LINE+2]]:21: note: type `Cpp.NonConstConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_expr_category.carbon:[[@LINE+11]]:21
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type
|
||||
// CHECK:STDERR: · │ ┃ `NonConstConversion` to `Cpp.Dest`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.NonConstConversion` does not implement
|
||||
// CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Dest)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -107,8 +115,20 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn InaccessibleConstructorTest(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+3]]:40: error: cannot access private member `InaccessibleConstructor` of type `Cpp.InaccessibleConstructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:21:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╭─┤ fail_access.carbon:[[@LINE+15]]:40
|
||||
// CHECK:STDERR: -> │ let _: Cpp.InaccessibleConstructor = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access private member
|
||||
// CHECK:STDERR: · ┃ `InaccessibleConstructor` of
|
||||
// CHECK:STDERR: · ┃ type
|
||||
// CHECK:STDERR: · ┃ `Cpp.InaccessibleConstructor`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./implicit_conversions.h
|
||||
// CHECK:STDERR: │ InaccessibleConstructor(Source);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.InaccessibleConstructor = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -116,8 +136,18 @@ fn InaccessibleConstructorTest(s: Cpp.Source) {
|
||||
|
||||
fn InaccessibleConversionTest(s: Cpp.InaccessibleConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+3]]:21: error: cannot access private member `<C++ operator>` of type `Cpp.InaccessibleConversion` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:26:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╭─┤ fail_access.carbon:[[@LINE+13]]:21
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access private member `<C++ operator>` of
|
||||
// CHECK:STDERR: · ┃ type `Cpp.InaccessibleConversion`
|
||||
// CHECK:STDERR: · ┃ [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./implicit_conversions.h
|
||||
// CHECK:STDERR: │ operator Dest() const;
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -131,8 +161,18 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn DeletedConstructorTest(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+3]]:35: error: cannot implicitly convert expression of type `Source` to `Cpp.DeletedConstructor` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+2]]:35: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.DeletedConstructor)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+13]]:35
|
||||
// CHECK:STDERR: -> │ let _: Cpp.DeletedConstructor = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert
|
||||
// CHECK:STDERR: · │ ┃ expression of type `Source` to
|
||||
// CHECK:STDERR: · │ ┃ `Cpp.DeletedConstructor`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╭─────────────────────────────────╯
|
||||
// CHECK:STDERR: · │ type `Cpp.Source` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.DeletedConstructor)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.DeletedConstructor = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -140,8 +180,16 @@ fn DeletedConstructorTest(s: Cpp.Source) {
|
||||
|
||||
fn DeletedConversionTest(s: Cpp.DeletedConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+3]]:21: error: cannot implicitly convert expression of type `DeletedConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+2]]:21: note: type `Cpp.DeletedConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_deleted.carbon:[[@LINE+11]]:21
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type
|
||||
// CHECK:STDERR: · │ ┃ `DeletedConversion` to `Cpp.Dest`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.DeletedConversion` does not implement
|
||||
// CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Dest)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -155,8 +203,18 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn ExplicitConstructorTest(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+3]]:36: error: cannot implicitly convert expression of type `Source` to `Cpp.ExplicitConstructor` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+2]]:36: note: type `Cpp.Source` does not implement interface `Core.ImplicitAs(Cpp.ExplicitConstructor)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_explicit.carbon:[[@LINE+13]]:36
|
||||
// CHECK:STDERR: -> │ let _: Cpp.ExplicitConstructor = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert
|
||||
// CHECK:STDERR: · │ ┃ expression of type `Source` to
|
||||
// CHECK:STDERR: · │ ┃ `Cpp.ExplicitConstructor`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╭──────────────────────────────────╯
|
||||
// CHECK:STDERR: · │ type `Cpp.Source` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.ExplicitConstructor)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.ExplicitConstructor = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -164,8 +222,16 @@ fn ExplicitConstructorTest(s: Cpp.Source) {
|
||||
|
||||
fn ExplicitConversionTest(s: Cpp.ExplicitConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+3]]:21: error: cannot implicitly convert expression of type `ExplicitConversion` to `Cpp.Dest` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_explicit.carbon:[[@LINE+2]]:21: note: type `Cpp.ExplicitConversion` does not implement interface `Core.ImplicitAs(Cpp.Dest)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_explicit.carbon:[[@LINE+11]]:21
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Dest = s;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type
|
||||
// CHECK:STDERR: · │ ┃ `ExplicitConversion` to `Cpp.Dest`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `Cpp.ExplicitConversion` does not implement
|
||||
// CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Dest)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
//@dump-sem-ir-end
|
||||
@@ -191,9 +257,21 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn IntConstructorTest(u: u32) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+4]]:31: error: cannot implicitly convert expression of type `u32` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+3]]:31: note: type `u32` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:38:21: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ╭─┤ fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+16]]:31
|
||||
// CHECK:STDERR: -> │ let _: Cpp.IntConstructor = u;
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression
|
||||
// CHECK:STDERR: · │ ┃ of type `u32` to `i32`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `u32` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(i32)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: ├─┤ ./implicit_conversions.h
|
||||
// CHECK:STDERR: │ IntConstructor(int);
|
||||
// CHECK:STDERR: · ┬
|
||||
// CHECK:STDERR: · ╰──┤ initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.IntConstructor = u;
|
||||
//@dump-sem-ir-end
|
||||
@@ -263,16 +341,43 @@ import Cpp library "aggregate.h";
|
||||
|
||||
fn InitFromTuple() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+3]]:26-27: error: cannot implicitly convert expression of type `()` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+2]]:26-27: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+11]]:26
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: · ┳━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `()` to `Cpp.Aggregate`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `()` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = ();
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+3]]:26-29: error: cannot implicitly convert expression of type `(Core.IntLiteral,)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+2]]:26-29: note: type `(Core.IntLiteral,)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+12]]:26
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: · ┳━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `(Core.IntLiteral,)` to
|
||||
// CHECK:STDERR: · │ ┃ `Cpp.Aggregate`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `(Core.IntLiteral,)` does not implement
|
||||
// CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Aggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = (1,);
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+3]]:26-31: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral)` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_tuple.carbon:[[@LINE+2]]:26-31: note: type `(Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_tuple.carbon:[[@LINE+13]]:26
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Aggregate = (1, 2);
|
||||
// CHECK:STDERR: · ┳━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `(Core.IntLiteral, Core.IntLiteral)`
|
||||
// CHECK:STDERR: · │ ┃ to `Cpp.Aggregate`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `(Core.IntLiteral, Core.IntLiteral)` does
|
||||
// CHECK:STDERR: · │ not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = (1, 2);
|
||||
//@dump-sem-ir-end
|
||||
@@ -286,16 +391,43 @@ import Cpp library "aggregate.h";
|
||||
|
||||
fn InitFromStruct() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+3]]:26-27: error: cannot implicitly convert expression of type `{}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+2]]:26-27: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+11]]:26
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Aggregate = {};
|
||||
// CHECK:STDERR: · ┳━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `{}` to `Cpp.Aggregate`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `{}` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = {};
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+3]]:26-33: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+2]]:26-33: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+12]]:26
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Aggregate = {.x = 1};
|
||||
// CHECK:STDERR: · ┳━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `{.x: Core.IntLiteral}` to
|
||||
// CHECK:STDERR: · │ ┃ `Cpp.Aggregate`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `{.x: Core.IntLiteral}` does not implement
|
||||
// CHECK:STDERR: · │ interface `Core.ImplicitAs(Cpp.Aggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = {.x = 1};
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+3]]:26-41: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.Aggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_aggregate_from_struct.carbon:[[@LINE+2]]:26-41: note: type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.Aggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_todo_aggregate_from_struct.carbon:[[@LINE+13]]:26
|
||||
// CHECK:STDERR: -> │ let _: Cpp.Aggregate = {.x = 1, .y = 2};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||
// CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type
|
||||
// CHECK:STDERR: · ┃ `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.Aggregate`
|
||||
// CHECK:STDERR: · ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰──┤ type `{.x: Core.IntLiteral, .y: Core.IntLiteral}`
|
||||
// CHECK:STDERR: · │ does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.Aggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Aggregate = {.x = 1, .y = 2};
|
||||
//@dump-sem-ir-end
|
||||
@@ -323,16 +455,45 @@ import Cpp library "aggregate.h";
|
||||
|
||||
fn InitFromStruct() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+3]]:29-30: error: cannot implicitly convert expression of type `{}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+2]]:29-30: note: type `{}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+11]]:29
|
||||
// CHECK:STDERR: -> │ let _: Cpp.NonAggregate = {};
|
||||
// CHECK:STDERR: · ┳━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `{}` to `Cpp.NonAggregate`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `{}` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NonAggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.NonAggregate = {};
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+3]]:29-36: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+2]]:29-36: note: type `{.x: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+13]]:29
|
||||
// CHECK:STDERR: -> │ let _: Cpp.NonAggregate = {.x = 1};
|
||||
// CHECK:STDERR: · ┳━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of
|
||||
// CHECK:STDERR: · │ ┃ type `{.x: Core.IntLiteral}` to
|
||||
// CHECK:STDERR: · │ ┃ `Cpp.NonAggregate`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `{.x: Core.IntLiteral}` does not
|
||||
// CHECK:STDERR: · │ implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NonAggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.NonAggregate = {.x = 1};
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+3]]:29-44: error: cannot implicitly convert expression of type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.NonAggregate` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_non_aggregate_from_struct.carbon:[[@LINE+2]]:29-44: note: type `{.x: Core.IntLiteral, .y: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.NonAggregate)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╭─┤ fail_non_aggregate_from_struct.carbon:[[@LINE+14]]:29
|
||||
// CHECK:STDERR: -> │ let _: Cpp.NonAggregate = {.x = 1, .y = 2};
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
||||
// CHECK:STDERR: · ┃ error: cannot implicitly convert expression of type
|
||||
// CHECK:STDERR: · ┃ `{.x: Core.IntLiteral, .y: Core.IntLiteral}` to `Cpp.NonAggregate`
|
||||
// CHECK:STDERR: · ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰──┤ type
|
||||
// CHECK:STDERR: · │ `{.x: Core.IntLiteral, .y: Core.IntLiteral}`
|
||||
// CHECK:STDERR: · │ does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Cpp.NonAggregate)`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.NonAggregate = {.x = 1, .y = 2};
|
||||
//@dump-sem-ir-end
|
||||
@@ -519,9 +680,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @NonConstConversionTest(%s.param: %NonConstConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %NonConstConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc11_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc19_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -599,56 +760,56 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @InaccessibleConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc11_40.1: ref %InaccessibleConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc11_40.2: ref %Source = value_as_ref %s.ref
|
||||
// CHECK:STDOUT: %addr.loc11_40.1: %ptr.5f6 = addr_of %.loc11_40.2
|
||||
// CHECK:STDOUT: %addr.loc11_40.2: %ptr.859 = addr_of %.loc11_40.1
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InaccessibleConstructor__carbon_thunk.decl(%addr.loc11_40.1, %addr.loc11_40.2)
|
||||
// CHECK:STDOUT: %.loc11_40.3: init %InaccessibleConstructor to %.loc11_40.1 = mark_in_place_init %InaccessibleConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc11_40.4: init %InaccessibleConstructor = converted %s.ref, %.loc11_40.3
|
||||
// CHECK:STDOUT: %.loc11_40.5: ref %InaccessibleConstructor = temporary %.loc11_40.1, %.loc11_40.4
|
||||
// CHECK:STDOUT: %.loc11_40.6: %InaccessibleConstructor = acquire_value %.loc11_40.5
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %InaccessibleConstructor.ref [concrete = constants.%InaccessibleConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc23_40.1: ref %InaccessibleConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc23_40.2: ref %Source = value_as_ref %s.ref
|
||||
// CHECK:STDOUT: %addr.loc23_40.1: %ptr.5f6 = addr_of %.loc23_40.2
|
||||
// CHECK:STDOUT: %addr.loc23_40.2: %ptr.859 = addr_of %.loc23_40.1
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InaccessibleConstructor__carbon_thunk.decl(%addr.loc23_40.1, %addr.loc23_40.2)
|
||||
// CHECK:STDOUT: %.loc23_40.3: init %InaccessibleConstructor to %.loc23_40.1 = mark_in_place_init %InaccessibleConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc23_40.4: init %InaccessibleConstructor = converted %s.ref, %.loc23_40.3
|
||||
// CHECK:STDOUT: %.loc23_40.5: ref %InaccessibleConstructor = temporary %.loc23_40.1, %.loc23_40.4
|
||||
// CHECK:STDOUT: %.loc23_40.6: %InaccessibleConstructor = acquire_value %.loc23_40.5
|
||||
// CHECK:STDOUT: %.loc23_13: type = splice_block %InaccessibleConstructor.ref [concrete = constants.%InaccessibleConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc23: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.ref: type = name_ref InaccessibleConstructor, imports.%InaccessibleConstructor.decl [concrete = constants.%InaccessibleConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %InaccessibleConstructor = wrapper_binding _, %.loc11_40.6
|
||||
// CHECK:STDOUT: %_: %InaccessibleConstructor = wrapper_binding _, %.loc23_40.6
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.824 = value_binding_pattern _ [concrete = constants.%_.patt.f1f]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc11_40.1: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc11_40.7: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc11_40.1 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc11_40.2: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc11_40.8: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc11_40.2 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc23_40.1: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc23_40.7: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc23_40.1 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc23_40.2: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc23_40.8: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc23_40.2 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc11_40.5)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc23_40.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InaccessibleConversionTest(%s.param: %InaccessibleConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %InaccessibleConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc20_21.1: ref %Dest = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc20_21.1
|
||||
// CHECK:STDOUT: %.loc42_21.1: ref %Dest = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc42_21.1
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr)
|
||||
// CHECK:STDOUT: %.loc20_21.2: init %Dest to %.loc20_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc20_21.3: init %Dest = converted %s.ref, %.loc20_21.2
|
||||
// CHECK:STDOUT: %.loc20_21.4: ref %Dest = temporary %.loc20_21.1, %.loc20_21.3
|
||||
// CHECK:STDOUT: %.loc20_21.5: %Dest = acquire_value %.loc20_21.4
|
||||
// CHECK:STDOUT: %.loc20_13: type = splice_block %Dest.ref [concrete = constants.%Dest] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc42_21.2: init %Dest to %.loc42_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc42_21.3: init %Dest = converted %s.ref, %.loc42_21.2
|
||||
// CHECK:STDOUT: %.loc42_21.4: ref %Dest = temporary %.loc42_21.1, %.loc42_21.3
|
||||
// CHECK:STDOUT: %.loc42_21.5: %Dest = acquire_value %.loc42_21.4
|
||||
// CHECK:STDOUT: %.loc42_13: type = splice_block %Dest.ref [concrete = constants.%Dest] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest = wrapper_binding _, %.loc20_21.5
|
||||
// CHECK:STDOUT: %_: %Dest = wrapper_binding _, %.loc42_21.5
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc20_21.1: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc20_21.6: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc20_21.1 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc20_21.2: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc20_21.7: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc20_21.2 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc42_21.1: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc42_21.6: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc42_21.1 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc42_21.2: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc42_21.7: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc42_21.2 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc20_21.4)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc42_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -683,9 +844,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @DeletedConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc11_35: %DeletedConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %DeletedConstructor.ref [concrete = constants.%DeletedConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc21_35: %DeletedConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc21_13: type = splice_block %DeletedConstructor.ref [concrete = constants.%DeletedConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %DeletedConstructor.ref: type = name_ref DeletedConstructor, imports.%DeletedConstructor.decl [concrete = constants.%DeletedConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %DeletedConstructor = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -698,9 +859,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @DeletedConversionTest(%s.param: %DeletedConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %DeletedConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc20_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc20_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc38_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc38_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -741,9 +902,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @ExplicitConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc11_36: %ExplicitConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %ExplicitConstructor.ref [concrete = constants.%ExplicitConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc21_36: %ExplicitConstructor = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc21_13: type = splice_block %ExplicitConstructor.ref [concrete = constants.%ExplicitConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ExplicitConstructor.ref: type = name_ref ExplicitConstructor, imports.%ExplicitConstructor.decl [concrete = constants.%ExplicitConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %ExplicitConstructor = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -756,9 +917,9 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @ExplicitConversionTest(%s.param: %ExplicitConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %ExplicitConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc20_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc20_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc38_21: %Dest.980 = converted %s.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc38_13: type = splice_block %Dest.ref [concrete = constants.%Dest.980] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest.980]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest.980 = wrapper_binding _, <error> [concrete = <error>]
|
||||
@@ -881,28 +1042,28 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @IntConstructorTest(%u.param: %u32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %u.ref: %u32 = name_ref u, %u
|
||||
// CHECK:STDOUT: %.loc12_31.1: ref %IntConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc12_31.2: %i32 = converted %u.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc12_31.1
|
||||
// CHECK:STDOUT: %.loc24_31.1: ref %IntConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc24_31.2: %i32 = converted %u.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc24_31.1
|
||||
// CHECK:STDOUT: %IntConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%IntConstructor__carbon_thunk.decl(<error>, %addr)
|
||||
// CHECK:STDOUT: %.loc12_31.3: init %IntConstructor to %.loc12_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc12_31.4: init %IntConstructor = converted %u.ref, %.loc12_31.3
|
||||
// CHECK:STDOUT: %.loc12_31.5: ref %IntConstructor = temporary %.loc12_31.1, %.loc12_31.4
|
||||
// CHECK:STDOUT: %.loc12_31.6: %IntConstructor = acquire_value %.loc12_31.5
|
||||
// CHECK:STDOUT: %.loc12_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] {
|
||||
// CHECK:STDOUT: %.loc24_31.3: init %IntConstructor to %.loc24_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc24_31.4: init %IntConstructor = converted %u.ref, %.loc24_31.3
|
||||
// CHECK:STDOUT: %.loc24_31.5: ref %IntConstructor = temporary %.loc24_31.1, %.loc24_31.4
|
||||
// CHECK:STDOUT: %.loc24_31.6: %IntConstructor = acquire_value %.loc24_31.5
|
||||
// CHECK:STDOUT: %.loc24_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %IntConstructor.ref: type = name_ref IntConstructor, imports.%IntConstructor.decl [concrete = constants.%IntConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc12_31.6
|
||||
// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc24_31.6
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc12_31.1: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc12_31.7: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc12_31.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc12_31.2: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc12_31.8: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc12_31.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc24_31.1: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc24_31.7: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc24_31.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc24_31.2: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc24_31.8: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc24_31.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc12_31.5)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc24_31.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1223,31 +1384,8 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InitFromTuple() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc11_27.2: %Aggregate = converted %.loc11_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %Aggregate.ref.loc11 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc11: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc11: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc11: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc15_29.1: %tuple.type.985 = tuple_literal (%int_1.loc15) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %.loc15_29.2: %Aggregate = converted %.loc15_29.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %Aggregate.ref.loc15 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc15: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc15: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc15: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc19_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc19, %int_2) [concrete = constants.%tuple.ad8]
|
||||
// CHECK:STDOUT: %.loc19_31.2: %Aggregate = converted %.loc19_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_27.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc19_27.2: %Aggregate = converted %.loc19_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %Aggregate.ref.loc19 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc19: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
@@ -1256,6 +1394,29 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc19: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc32: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc32_29.1: %tuple.type.985 = tuple_literal (%int_1.loc32) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %.loc32_29.2: %Aggregate = converted %.loc32_29.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc32_13: type = splice_block %Aggregate.ref.loc32 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc32: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc32: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc32: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc46: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc46_31.1: %tuple.type.f94 = tuple_literal (%int_1.loc46, %int_2) [concrete = constants.%tuple.ad8]
|
||||
// CHECK:STDOUT: %.loc46_31.2: %Aggregate = converted %.loc46_31.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc46_13: type = splice_block %Aggregate.ref.loc46 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc46: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc46: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc46: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1286,31 +1447,8 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InitFromStruct() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_27.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_27.2: %Aggregate = converted %.loc11_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %Aggregate.ref.loc11 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc11: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc11: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc11: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc15_33.1: %struct_type.x = struct_literal (%int_1.loc15) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc15_33.2: %Aggregate = converted %.loc15_33.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %Aggregate.ref.loc15 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc15: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc15: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc15: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc19_41.1: %struct_type.x.y = struct_literal (%int_1.loc19, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc19_41.2: %Aggregate = converted %.loc19_41.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_27.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc19_27.2: %Aggregate = converted %.loc19_27.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %Aggregate.ref.loc19 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc19: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
@@ -1319,6 +1457,29 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc19: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc32: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc32_33.1: %struct_type.x = struct_literal (%int_1.loc32) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc32_33.2: %Aggregate = converted %.loc32_33.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc32_13: type = splice_block %Aggregate.ref.loc32 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc32: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc32: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc32: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc46: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc46_41.1: %struct_type.x.y = struct_literal (%int_1.loc46, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc46_41.2: %Aggregate = converted %.loc46_41.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc46_13: type = splice_block %Aggregate.ref.loc46 [concrete = constants.%Aggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Aggregate.ref.loc46: type = name_ref Aggregate, imports.%Aggregate.decl [concrete = constants.%Aggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc46: %Aggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc46: %pattern_type.5dc = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1525,31 +1686,8 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InitFromStruct() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_30.2: %NonAggregate = converted %.loc11_30.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %NonAggregate.ref.loc11 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc11: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc11: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc11: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc15_36.1: %struct_type.x = struct_literal (%int_1.loc15) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc15_36.2: %NonAggregate = converted %.loc15_36.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %NonAggregate.ref.loc15 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc15: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc15: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc15: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc19: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc19_44.1: %struct_type.x.y = struct_literal (%int_1.loc19, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc19_44.2: %NonAggregate = converted %.loc19_44.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc19_30.2: %NonAggregate = converted %.loc19_30.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %NonAggregate.ref.loc19 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc19: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
@@ -1558,6 +1696,29 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc19: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc33_36.1: %struct_type.x = struct_literal (%int_1.loc33) [concrete = constants.%struct.147]
|
||||
// CHECK:STDOUT: %.loc33_36.2: %NonAggregate = converted %.loc33_36.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc33_13: type = splice_block %NonAggregate.ref.loc33 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc33: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc33: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc33: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %int_1.loc48: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc48_44.1: %struct_type.x.y = struct_literal (%int_1.loc48, %int_2) [concrete = constants.%struct.004]
|
||||
// CHECK:STDOUT: %.loc48_44.2: %NonAggregate = converted %.loc48_44.1, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc48_13: type = splice_block %NonAggregate.ref.loc48 [concrete = constants.%NonAggregate] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc48: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %NonAggregate.ref.loc48: type = name_ref NonAggregate, imports.%NonAggregate.decl [concrete = constants.%NonAggregate]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_.loc48: %NonAggregate = wrapper_binding _, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt.loc48: %pattern_type.273 = value_binding_pattern _ [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
Reference in new issue
Block a user