Debian Codegraph @

gcc/testsuite/gdc.test/runnable/test20687.d

raw
1 // PERMUTE_ARGS:
2 // https://issues.dlang.org/show_bug.cgi?id=20687
3
4 struct S
5 {
6 void foo(){}
7 }
8
9 void main()
10 {
11 S i;
12 enum fpe = &S.foo;
13 const fp = &S.foo;
14 const dg = &i.foo;
15
16 // Allow these
17 static dgfp = &S.foo;
18 static const dgfpc = &S.foo;
19 static immutable dgfpi = &S.foo;
20 __gshared dgfpg = &S.foo;
21 __gshared const dgfpgc = &S.foo;
22 __gshared immutable dgfpgi = &S.foo;
23
24 static foreach (v; [fp, dgfpc, dgfpi, dgfpgc, dgfpgi])
25 static assert(fpe == v);
26
27 assert(fp == dg.funcptr && fp == dgfp && fp == dgfpg);
28 }