MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test15989.d
blob38ca33126724644efa7ddd18d656bb875490fb50
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/test15989.d(39): Error: variable `test15989.main.ctRegex` : Unable to initialize enum with class or pointer to struct. Use static const variable instead.
5 fail_compilation/test15989.d(48): Error: variable `test15989.test.c` : Unable to initialize enum with class or pointer to struct. Use static const variable instead.
6 fail_compilation/test15989.d(49): Error: cannot use non-constant CTFE pointer in an initializer `new int(3)`
7 ---
8 */
10 // https://issues.dlang.org/show_bug.cgi?id=15989
12 import core.stdc.stdio;
14 interface Kickstart{
15 bool foo( int );
18 class ShiftOr : Kickstart
20 bool foo( int i )
22 printf("i = %d\n", i);
23 return false;
27 struct Regex
29 Kickstart kickstart;
32 Regex regex()
34 return Regex(new ShiftOr());
37 void main()
39 enum ctRegex = regex();
40 Regex r = ctRegex;
41 r.kickstart.foo(7);
44 class C { }
46 void test()
48 enum c = new C();
49 enum pi = new int(3);