Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail20730a.d

raw
1 /*
2 REQUIRED_ARGS: -o-
3 TEST_OUTPUT:
4 ---
5 fail_compilation/fail20730a.d(11): Error: undefined identifier `undef20730`
6 ---
7 */
8 void test20730()
9 {
10 auto f = File().byLine;
11 undef20730();
12 }
13
14 struct File
15 {
16 shared uint refs;
17
18 this(this)
19 {
20 atomicOp!"+="(refs, 1);
21 }
22
23 struct ByLineImpl(Char)
24 {
25 File file;
26 char[] line;
27 }
28
29 auto byLine()
30 {
31 return ByLineImpl!char();
32 }
33 }
34
35 T atomicOp(string op, T, V1)(ref shared T val, V1 mod)
36 if (__traits(compiles, mixin("*cast(T*)&val" ~ op ~ "mod")))
37 {
38 return val;
39 }