gcc/testsuite/gdc.test/fail_compilation/test23905.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=23905 |
| 2 | |
| 3 | /* |
| 4 | TEST_OUTPUT: |
| 5 | --- |
| 6 | fail_compilation/test23905.d(24): Error: enum `test23905.Foo` is opaque and has no default initializer |
| 7 | --- |
| 8 | */ |
| 9 | |
| 10 | struct SumType(T) |
| 11 | { |
| 12 | T storage; |
| 13 | |
| 14 | bool opEquals(Rhs)(Rhs rhs) |
| 15 | if (is(typeof(Rhs.init))) |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | } |
| 20 | |
| 21 | enum Foo; |
| 22 | |
| 23 | void main(){ |
| 24 | SumType!Foo data = Foo.init; |
| 25 | } |