d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / disable_new.d
blob33ae32c2d8ab0f44b76f7afa06cb606b16e4ef72
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/disable_new.d(23): Error: cannot allocate `class C` with `new` because it is annotated with `@disable new()`
5 fail_compilation/disable_new.d(24): Error: cannot allocate `struct S` with `new` because it is annotated with `@disable new()`
6 ---
7 */
9 class C
11 // force user of a type to use an external allocation strategy
12 @disable new();
15 struct S
17 // force user of a type to use an external allocation strategy
18 @disable new();
21 void main()
23 auto c = new C();
24 auto s = new S();