File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 44
44
// CHECK: func __getIteratorBoxUnsafe() -> IteratorBox
45
45
// CHECK-SKIP-UNSAFE-NOT: func __getIteratorBoxUnsafe() -> IteratorBox
46
46
// CHECK: }
47
+
48
+ // CHECK: struct StructCopyableMovableAnnotatedNonCopyable
Original file line number Diff line number Diff line change 1
- // Test various aspects of the C++ `nodiscard` keyword.
2
-
3
1
// RUN: %target-typecheck-verify-swift -I %S/Inputs -cxx-interoperability-mode=upcoming-swift
4
2
5
3
import TypeClassification
6
4
7
5
func test( ) {
6
+ let x = StructWithPointerNonCopyableTriviallyMovable ( )
7
+ let v = copy x // expected-error {{'copy' cannot be applied to noncopyable types}}
8
+ _ = v
9
+ }
10
+
11
+ func testField( ) {
12
+ let x = StructWithPointerNonCopyableTriviallyMovableField ( )
13
+ let v = copy x // expected-error {{'copy' cannot be applied to noncopyable types}}
14
+ _ = v
15
+ }
16
+
17
+ func testAnnotated( ) {
8
18
let x = StructCopyableMovableAnnotatedNonCopyable ( )
9
19
let v = copy x // expected-error {{'copy' cannot be applied to noncopyable types}}
10
20
_ = v
11
21
}
12
22
13
23
test ( )
24
+ testField ( )
25
+ testAnnotated ( )
You can’t perform that action at this time.
0 commit comments