Skip to content

Commit ac52cb9

Browse files
committed
Add compile error test case for union layout depending on pointer alignment
1 parent 5ebacab commit ac52cb9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const U = union {
2+
next: ?*align(1) U align(128),
3+
};
4+
5+
export fn entry() usize {
6+
return @alignOf(U);
7+
}
8+
9+
// error
10+
//
11+
// :1:11: error: union layout depends on being pointer aligned

0 commit comments

Comments
 (0)