gcc/testsuite/gdc.test/compilable/test21372.d
raw| 1 | // REQUIRED_ARGS: -de |
| 2 | struct S |
| 3 | { |
| 4 | deprecated void foo(T)(int) { } |
| 5 | void foo(T)(string) { } |
| 6 | } |
| 7 | |
| 8 | // just to be safe, check this order too |
| 9 | // (there were some issues where naive checks of overloads were order dependent) |
| 10 | struct T |
| 11 | { |
| 12 | void foo(T)(string) { } |
| 13 | deprecated void foo(T)(int) { } |
| 14 | } |
| 15 | |
| 16 | void main() |
| 17 | { |
| 18 | // this should not hit the deprecation |
| 19 | // because the parameter type doesn't match it |
| 20 | S().foo!int("hi"); |
| 21 | |
| 22 | // likewise |
| 23 | T().foo!int("hi"); |
| 24 | } |