Skip to content

Commit b71fa49

Browse files
Merge pull request swiftlang#71288 from nate-chandler/bitwise-copyable/typeinfo-fix
[BitwiseCopyable] Fixed TypeInfo flags.
2 parents 12de745 + 5330633 commit b71fa49

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

lib/IRGen/GenArchetype.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ class BitwiseCopyableArchetypeTypeInfo
179179
using Super = WitnessSizedTypeInfo<Self>;
180180
BitwiseCopyableArchetypeTypeInfo(llvm::Type *type,
181181
IsABIAccessible_t abiAccessible)
182-
: Super(type, Alignment(1), IsTriviallyDestroyable, IsBitwiseTakable,
183-
IsCopyable, abiAccessible) {}
182+
: Super(type, Alignment(1), IsNotTriviallyDestroyable,
183+
IsNotBitwiseTakable, IsCopyable, abiAccessible) {}
184184

185185
public:
186186
static const BitwiseCopyableArchetypeTypeInfo *
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: %target-swift-frontend \
2+
// RUN: -primary-file %s \
3+
// RUN: -emit-ir \
4+
// RUN: -disable-availability-checking \
5+
// RUN: -enable-experimental-feature BitwiseCopyable \
6+
// RUN: -enable-builtin-module \
7+
// RUN: | \
8+
// RUN: %FileCheck %s
9+
10+
11+
// CHECK-LABEL: define{{.*}} ptr @"$s22bitwise_copyable_onone1EOy1AQzGAA1PRzs16_BitwiseCopyableAERQlWOh"(
12+
// CHECK-SAME: ptr %0,
13+
// CHECK-SAME: ptr %I.A,
14+
// CHECK-SAME: ptr %"E<I.A>"
15+
// CHECK-SAME: )
16+
enum E<Element> {
17+
case next(Element)
18+
case error(Any)
19+
}
20+
21+
protocol P {
22+
associatedtype A
23+
}
24+
25+
class C<I: P> where I.A: _BitwiseCopyable {
26+
func takeE(_ event: E<I.A>) {}
27+
func run(_ e: I.A) {
28+
takeE(.next(e))
29+
}
30+
}

0 commit comments

Comments
 (0)