| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail10964.d(28): Error: function `fail10964.S.this(this)` is not `nothrow` |
| 5 |
fail_compilation/fail10964.d(29): Error: function `fail10964.S.this(this)` is not `nothrow` |
| 6 |
fail_compilation/fail10964.d(30): Error: function `fail10964.S.this(this)` is not `nothrow` |
| 7 |
fail_compilation/fail10964.d(33): Error: function `fail10964.S.this(this)` is not `nothrow` |
| 8 |
fail_compilation/fail10964.d(34): Error: function `fail10964.S.this(this)` is not `nothrow` |
| 9 |
fail_compilation/fail10964.d(35): Error: function `fail10964.S.this(this)` is not `nothrow` |
| 10 |
fail_compilation/fail10964.d(22): Error: function `fail10964.foo` may throw but is marked as `nothrow` |
| 11 |
--- |
| 12 |
*/ |
| 13 |
|
| 14 |
struct S |
| 15 |
{ |
| 16 |
this(this) |
| 17 |
{ |
| 18 |
throw new Exception("BOOM!"); |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
void foo() nothrow |
| 23 |
{ |
| 24 |
S ss; |
| 25 |
S[1] sa; |
| 26 |
|
| 27 |
// TOKassign |
| 28 |
ss = ss; |
| 29 |
sa = ss; |
| 30 |
sa = sa; |
| 31 |
|
| 32 |
// TOKconstruct |
| 33 |
S ss2 = ss; |
| 34 |
S[1] sa2 = ss; |
| 35 |
S[1] sa3 = sa; |
| 36 |
} |