Daily bump.
[official-gcc.git] / gcc / testsuite / gdc.test / compilable / dtorfields_deprecation.d
blob83014e38e471e64a9211240baf25aa784859fb5c
1 /**
2 Checks that code still compiles when -preview=dtorfields is enabled by default
3 but issues an appropriate deprecation message.
5 Remove this test when the deprecations period ends, see visit(CtorDeclaration)
6 in semantic3.d
8 TEST_OUTPUT:
9 ---
10 compilable/dtorfields_deprecation.d(30): Deprecation: `dtorfields_deprecation.Pure.this` has stricter attributes than its destructor (`pure`)
11 compilable/dtorfields_deprecation.d(30): The destructor will be called if an exception is thrown
12 compilable/dtorfields_deprecation.d(30): Either make the constructor `nothrow` or adjust the field destructors
13 compilable/dtorfields_deprecation.d(42): Deprecation: `dtorfields_deprecation.NoGC.this` has stricter attributes than its destructor (`@nogc`)
14 compilable/dtorfields_deprecation.d(42): The destructor will be called if an exception is thrown
15 compilable/dtorfields_deprecation.d(42): Either make the constructor `nothrow` or adjust the field destructors
16 compilable/dtorfields_deprecation.d(48): Deprecation: `dtorfields_deprecation.Safe.this` has stricter attributes than its destructor (`@system`)
17 compilable/dtorfields_deprecation.d(48): The destructor will be called if an exception is thrown
18 compilable/dtorfields_deprecation.d(48): Either make the constructor `nothrow` or adjust the field destructors
19 ---
20 **/
22 struct HasDtor
24 ~this() {}
27 struct Pure
29 HasDtor member;
30 this(int) pure {}
33 struct Nothrow
35 HasDtor member;
36 this(int) nothrow {}
39 struct NoGC
41 HasDtor member;
42 this(int) @nogc {}
45 struct Safe
47 HasDtor member;
48 this(int) @safe {}