Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/udaparams.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/udaparams.d(31): Error: variadic parameter cannot have user-defined attributes
5 fail_compilation/udaparams.d(32): Error: variadic parameter cannot have user-defined attributes
6 fail_compilation/udaparams.d(34): Error: user-defined attributes cannot appear as postfixes
7 fail_compilation/udaparams.d(35): Error: user-defined attributes cannot appear as postfixes
8 fail_compilation/udaparams.d(36): Error: user-defined attributes cannot appear as postfixes
9 fail_compilation/udaparams.d(38): Error: `@safe` attribute for function parameter is not supported
10 fail_compilation/udaparams.d(39): Error: `@safe` attribute for function parameter is not supported
11 fail_compilation/udaparams.d(40): Error: `@safe` attribute for function parameter is not supported
12 fail_compilation/udaparams.d(43): Error: `@system` attribute for function parameter is not supported
13 fail_compilation/udaparams.d(44): Error: `@trusted` attribute for function parameter is not supported
14 fail_compilation/udaparams.d(45): Error: `@nogc` attribute for function parameter is not supported
15 fail_compilation/udaparams.d(51): Error: cannot put a storage-class in an `alias` declaration.
16 fail_compilation/udaparams.d(52): Error: cannot put a storage-class in an `alias` declaration.
17 fail_compilation/udaparams.d(53): Error: semicolon expected to close `alias` declaration, not `=>`
18 fail_compilation/udaparams.d(53): Error: declaration expected, not `1`
19 fail_compilation/udaparams.d(54): Error: semicolon expected to close `alias` declaration, not `=>`
20 fail_compilation/udaparams.d(54): Error: declaration expected, not `1`
21 fail_compilation/udaparams.d(57): Error: basic type expected, not `@`
22 fail_compilation/udaparams.d(57): Error: identifier expected for template value parameter
23 fail_compilation/udaparams.d(57): Error: found `@` when expecting `)`
24 fail_compilation/udaparams.d(57): Error: basic type expected, not `3`
25 fail_compilation/udaparams.d(57): Error: found `3` when expecting `)`
26 fail_compilation/udaparams.d(57): Error: semicolon expected following function declaration, not `)`
27 fail_compilation/udaparams.d(57): Error: variable name expected after type `T`, not `)`
28 fail_compilation/udaparams.d(57): Error: declaration expected, not `)`
29 ---
30 */
31 void vararg1(int a, @(10) ...);
32 extern(C) void vararg2(int a, @(10) ...);
33
34 void rhsuda(int a @(10));
35 void rhsuda2(int @(10));
36 void rhsuda3(int[] arr @(10) ...);
37
38 void wrongAttr1(@safe int);
39 void wrongAttr2(@safe void function());
40 void wrongAttr3(@safe void delegate());
41
42
43 void test16(A)(A a @system);
44 void test16(A)(A a @trusted);
45 void test16(A)(A a @nogc);
46
47 // lambdas without parentheses
48 alias test19a = @safe b => 1 + 2;
49 alias test19b = @system b => 1 + 2;
50 alias test19c = @nogc b => 1 + 2;
51 alias test19d = @(2) @system b => 1 + 2;
52 alias test19e = @safe @(2) b => 1 + 2;
53 alias test19f = extern(C++) b => 1 + 2;
54 alias test19g = align(2) b => 1 + 2;
55
56 // UDAs on Template parameter aren't supported
57 void test21(@(3) T)(T t) {}