| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/parseStc2.d(11): Error: conflicting attribute `const` |
| 5 |
fail_compilation/parseStc2.d(12): Error: conflicting attribute `@system` |
| 6 |
fail_compilation/parseStc2.d(13): Error: conflicting attribute `@safe` |
| 7 |
fail_compilation/parseStc2.d(14): Error: conflicting attribute `@trusted` |
| 8 |
fail_compilation/parseStc2.d(15): Error: conflicting attribute `__gshared` |
| 9 |
--- |
| 10 |
*/ |
| 11 |
immutable const void f4() {} |
| 12 |
@safe @system void f4() {} |
| 13 |
@trusted @safe void f4() {} |
| 14 |
@system @trusted void f4() {} |
| 15 |
shared __gshared f4() {} |
| 16 |
|
| 17 |
/* |
| 18 |
TEST_OUTPUT: |
| 19 |
--- |
| 20 |
fail_compilation/parseStc2.d(26): Error: redundant attribute `static` |
| 21 |
fail_compilation/parseStc2.d(27): Error: redundant attribute `pure` |
| 22 |
fail_compilation/parseStc2.d(28): Error: redundant attribute `@property` |
| 23 |
fail_compilation/parseStc2.d(29): Error: redundant attribute `@safe` |
| 24 |
--- |
| 25 |
*/ |
| 26 |
static static void f1() {} |
| 27 |
pure nothrow pure void f2() {} |
| 28 |
@property extern(C) @property void f3() {} |
| 29 |
deprecated("") @safe @safe void f4() {} |
| 30 |
@(1) @(1) void f5() {} // OK |
| 31 |
|
| 32 |
/* |
| 33 |
TEST_OUTPUT: |
| 34 |
--- |
| 35 |
fail_compilation/parseStc2.d(39): Error: redundant linkage `extern (C)` |
| 36 |
fail_compilation/parseStc2.d(40): Error: conflicting linkage `extern (C)` and `extern (C++)` |
| 37 |
--- |
| 38 |
*/ |
| 39 |
extern(C) extern(C) void f6() {} |
| 40 |
extern(C) extern(C++) void f7() {} |
| 41 |
extern(C++, foo) extern(C++, bar) void f8() {} // OK |
| 42 |
|
| 43 |
/* |
| 44 |
TEST_OUTPUT: |
| 45 |
--- |
| 46 |
fail_compilation/parseStc2.d(50): Error: redundant visibility attribute `public` |
| 47 |
fail_compilation/parseStc2.d(51): Error: conflicting visibility attribute `public` and `private` |
| 48 |
--- |
| 49 |
*/ |
| 50 |
public public void f9() {} |
| 51 |
public private void f10() {} |
| 52 |
|
| 53 |
/* |
| 54 |
TEST_OUTPUT: |
| 55 |
--- |
| 56 |
fail_compilation/parseStc2.d(63): Error: redundant alignment attribute `align(default)` |
| 57 |
fail_compilation/parseStc2.d(64): Error: redundant alignment attribute `align(1)` |
| 58 |
fail_compilation/parseStc2.d(65): Error: redundant alignment attribute `align(1)` |
| 59 |
fail_compilation/parseStc2.d(66): Error: redundant alignment attribute `align(default)` |
| 60 |
fail_compilation/parseStc2.d(67): Error: redundant alignment attribute `align(2)` |
| 61 |
--- |
| 62 |
*/ |
| 63 |
align align void f11() {} |
| 64 |
align(1) align(1) void f12() {} |
| 65 |
align align(1) void f13() {} |
| 66 |
align(1) align void f14() {} |
| 67 |
align(1) align(2) void f15() {} |
| 68 |
|
| 69 |
/* |
| 70 |
TEST_OUTPUT: |
| 71 |
--- |
| 72 |
fail_compilation/parseStc2.d(76): Error: redundant linkage `extern (System)` |
| 73 |
fail_compilation/parseStc2.d(77): Error: conflicting linkage `extern (System)` and `extern (C++)` |
| 74 |
--- |
| 75 |
*/ |
| 76 |
extern(System) extern(System) void f16() {} |
| 77 |
extern(System) extern(C++) void f17() {} |