| 1 |
/* REQUIRED_ARGS: -de -unittest |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail21831.d(19): Deprecation: struct `fail21831.S21831` is deprecated - Deprecated type |
| 5 |
fail_compilation/fail21831.d(19): Deprecation: template `fail21831.test21831(T)(T t) if (__traits(isDeprecated, T))` is deprecated - Deprecated template |
| 6 |
fail_compilation/fail21831.d(19): Deprecation: struct `fail21831.S21831` is deprecated - Deprecated type |
| 7 |
--- |
| 8 |
*/ |
| 9 |
#line 1 |
| 10 |
deprecated("Deprecated type") |
| 11 |
struct S21831 { } |
| 12 |
|
| 13 |
auto test21831(T)(T t) |
| 14 |
if (!__traits(isDeprecated, T)) |
| 15 |
{ |
| 16 |
return T.init; |
| 17 |
} |
| 18 |
|
| 19 |
deprecated("Deprecated template") |
| 20 |
auto test21831(T)(T t) |
| 21 |
if (__traits(isDeprecated, T)) |
| 22 |
{ |
| 23 |
return T.init; |
| 24 |
} |
| 25 |
|
| 26 |
unittest |
| 27 |
{ |
| 28 |
auto b = test21831(S21831()); |
| 29 |
} |