Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail195.d(22): Error: struct `Foo` does not overload ()
5 ---
6 */
7
8 // https://issues.dlang.org/show_bug.cgi?id=1384
9 // Compiler segfaults when using struct variable like a function with no opCall member.
10 struct Foo
11 {
12 union
13 {
14 int a;
15 int b;
16 }
17 }
18
19 void bla()
20 {
21 Foo next;
22 next(); // Error: structliteral has no effect in expression (Foo(0))
23 }