master
1fn okay_func() void {}
2
3const a align(64) = okay_func;
4const b addrspace(.generic) = okay_func;
5const c linksection("irrelevant") = okay_func;
6
7const d align(64) = 1.23;
8const e addrspace(.generic) = 1.23;
9const f linksection("irrelevant") = 1.23;
10
11const g: comptime_float align(64) = 1.23;
12const h: comptime_float addrspace(.generic) = 1.23;
13const i: comptime_float linksection("irrelevant") = 1.23;
14
15// zig fmt: off
16comptime { _ = a; }
17comptime { _ = b; }
18comptime { _ = c; }
19comptime { _ = d; }
20comptime { _ = e; }
21comptime { _ = f; }
22comptime { _ = g; }
23comptime { _ = h; }
24comptime { _ = 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