gcc/testsuite/gdc.test/compilable/test21831.d
raw| 1 | // REQUIRED_ARGS: -de -unittest |
| 2 | |
| 3 | deprecated struct S21831 { } |
| 4 | |
| 5 | auto test21831(T)(T t) // error: struct `S21831` is deprecated |
| 6 | if (!__traits(isDeprecated, T)) |
| 7 | { |
| 8 | return T.init; |
| 9 | } |
| 10 | |
| 11 | deprecated auto test21831(T)(T t) |
| 12 | if (__traits(isDeprecated, T)) |
| 13 | { |
| 14 | return T.init; |
| 15 | } |
| 16 | |
| 17 | deprecated unittest |
| 18 | { |
| 19 | auto b = test21831(S21831()); // instantiated from here |
| 20 | } |