|
1 | | -/* REQUIRED_ARGS: -o- -de |
| 1 | +/* REQUIRED_ARGS: -o- |
2 | 2 | TEST_OUTPUT: |
3 | 3 | --- |
4 | | -fail_compilation/commaexp.d(24): Deprecation: Using the result of a comma expression is deprecated |
5 | | -fail_compilation/commaexp.d(36): Deprecation: Using the result of a comma expression is deprecated |
6 | | -fail_compilation/commaexp.d(37): Deprecation: Using the result of a comma expression is deprecated |
7 | | -fail_compilation/commaexp.d(38): Deprecation: Using the result of a comma expression is deprecated |
8 | | -fail_compilation/commaexp.d(39): Deprecation: Using the result of a comma expression is deprecated |
9 | | -fail_compilation/commaexp.d(41): Deprecation: Using the result of a comma expression is deprecated |
10 | | -fail_compilation/commaexp.d(42): Deprecation: Using the result of a comma expression is deprecated |
| 4 | +fail_compilation/commaexp.d(27): Error: The result of a comma expression can't be used |
| 5 | +fail_compilation/commaexp.d(39): Error: The result of a comma expression can't be used |
| 6 | +fail_compilation/commaexp.d(40): Error: The result of a comma expression can't be used |
| 7 | +fail_compilation/commaexp.d(41): Error: The result of a comma expression can't be used |
| 8 | +fail_compilation/commaexp.d(42): Error: The result of a comma expression can't be used |
| 9 | +fail_compilation/commaexp.d(44): Error: The result of a comma expression can't be used |
| 10 | +fail_compilation/commaexp.d(45): Error: The result of a comma expression can't be used |
| 11 | +fail_compilation/commaexp.d(56): Error: The result of a comma expression can't be used |
| 12 | +fail_compilation/commaexp.d(69): Error: The result of a comma expression can't be used |
| 13 | +fail_compilation/commaexp.d(81): Error: The result of a comma expression can't be used |
11 | 14 | --- |
12 | 15 | */ |
13 | 16 |
|
@@ -41,3 +44,39 @@ int main () { |
41 | 44 | ok = true, (ok = (true, false)); |
42 | 45 | return 42, 0; |
43 | 46 | } |
| 47 | + |
| 48 | + |
| 49 | +/***************************************************/ |
| 50 | +// 16022 |
| 51 | + |
| 52 | +bool test16022() |
| 53 | +{ |
| 54 | + enum Type { Colon, Comma } |
| 55 | + Type type; |
| 56 | + return type == Type.Colon, type == Type.Comma; |
| 57 | +} |
| 58 | + |
| 59 | +bool test16022_structs() |
| 60 | +{ |
| 61 | + struct A |
| 62 | + { |
| 63 | + int i; |
| 64 | + string s; |
| 65 | + } |
| 66 | + |
| 67 | + enum Type { Colon = A(0, "zero"), Comma = A(1, "one") } |
| 68 | + Type type; |
| 69 | + return type == Type.Colon, type == Type.Comma; |
| 70 | +} |
| 71 | + |
| 72 | +/********************************************/ |
| 73 | + |
| 74 | + |
| 75 | +void bar11(int*, int*) { } |
| 76 | + |
| 77 | +void test11() |
| 78 | +{ |
| 79 | + static int* p; |
| 80 | + static int i; |
| 81 | + bar11((i,p), &i); |
| 82 | +} |
0 commit comments