| 1 | fn okay_func() void {} |
| 2 | |
| 3 | const a align(64) = okay_func; |
| 4 | const b addrspace(.generic) = okay_func; |
| 5 | const c linksection("irrelevant") = okay_func; |
| 6 | |
| 7 | const d align(64) = 1.23; |
| 8 | const e addrspace(.generic) = 1.23; |
| 9 | const f linksection("irrelevant") = 1.23; |
| 10 | |
| 11 | const g: comptime_float align(64) = 1.23; |
| 12 | const h: comptime_float addrspace(.generic) = 1.23; |
| 13 | const i: comptime_float linksection("irrelevant") = 1.23; |
| 14 | |
| 15 | // zig fmt: off |
| 16 | comptime { _ = a; } |
| 17 | comptime { _ = b; } |
| 18 | comptime { _ = c; } |
| 19 | comptime { _ = d; } |
| 20 | comptime { _ = e; } |
| 21 | comptime { _ = f; } |
| 22 | comptime { _ = g; } |
| 23 | comptime { _ = h; } |
| 24 | comptime { _ = i; } |
| 25 | // zig fmt: on |
| 26 | |
| 27 | // error |
| 28 | // |
| 29 | // :3:15: error: cannot specify alignment of function alias |
| 30 | // :4:20: error: cannot specify addrspace of function alias |
| 31 | // :5:21: error: cannot specify linksection of function alias |
| 32 | // :7:15: error: cannot specify alignment of comptime-only type |
| 33 | // :8:20: error: cannot specify addrspace of comptime-only type |
| 34 | // :9:21: error: cannot specify linksection of comptime-only type |
| 35 | // :11:31: error: cannot specify alignment of comptime-only type |
| 36 | // :12:36: error: cannot specify addrspace of comptime-only type |
| 37 | // :13:37: error: cannot specify linksection of comptime-only type |