diff options
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/test21830.d')
-rw-r--r-- | gcc/testsuite/gdc.test/compilable/test21830.d | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/test21830.d b/gcc/testsuite/gdc.test/compilable/test21830.d new file mode 100644 index 00000000000..d1ead010d88 --- /dev/null +++ b/gcc/testsuite/gdc.test/compilable/test21830.d @@ -0,0 +1,25 @@ +// REQUIRED_ARGS: -de -unittest + +deprecated struct OldS21830 { } + +struct NewS21830 { } + +static if (1) +{ + auto test21830(T)(T t) + if (is(T == NewS21830)) + { + return T.init; + } +} + +deprecated auto test21830(T)(T t) +if (is(T == OldS21830)) +{ + return T.init; +} + +unittest +{ + auto b = test21830(NewS21830()); // error here about using test21830!OldS21830 +} |