]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/fail10964.d
d: Merge upstream dmd 3982604c5, druntime bc58b1e9, phobos 12329adb6.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail10964.d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail10964.d(28): Error: function `fail10964.S.__postblit` is not `nothrow`
5 fail_compilation/fail10964.d(29): Error: function `fail10964.S.__postblit` is not `nothrow`
6 fail_compilation/fail10964.d(30): Error: function `fail10964.S.__postblit` is not `nothrow`
7 fail_compilation/fail10964.d(33): Error: function `fail10964.S.__postblit` is not `nothrow`
8 fail_compilation/fail10964.d(34): Error: function `core.internal.array.construction._d_arraysetctor!(S[], S)._d_arraysetctor` is not `nothrow`
9 fail_compilation/fail10964.d(35): Error: function `core.internal.array.construction._d_arrayctor!(S[], S)._d_arrayctor` is not `nothrow`
10 fail_compilation/fail10964.d(22): Error: `nothrow` function `fail10964.foo` may throw
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 }