gcc/testsuite/gdc.test/fail_compilation/test22818.d
raw| 1 | /* REQUIRED_ARGS: -preview=dip1000 |
| 2 | * TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/test22818.d(102): Deprecation: typesafe variadic parameters with a `class` type (`C c...`) are deprecated |
| 5 | fail_compilation/test22818.d(104): Error: scope parameter `c` may not be returned |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | // issues.dlang.org/show_bug.cgi?id=22818 |
| 10 | |
| 11 | #line 100 |
| 12 | |
| 13 | @safe: |
| 14 | ref int g(C c ...) |
| 15 | { |
| 16 | return c.x; |
| 17 | } |
| 18 | |
| 19 | class C |
| 20 | { |
| 21 | int x; |
| 22 | } |