]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.dg/torture/gdc248.d
c++: Stop defining true, false and bool as macros in <stdbool.h>
[thirdparty/gcc.git] / gcc / testsuite / gdc.dg / torture / gdc248.d
1 // https://bugzilla.gdcproject.org/show_bug.cgi?id=248
2 // { dg-do run }
3 // { dg-skip-if "needs gcc/config.d" { ! d_runtime } }
4
5 class C248b
6 {
7 bool isintegral()
8 {
9 return false;
10 }
11 }
12
13 class C248a
14 {
15 int count = 0;
16
17 C248b getMemtype()
18 {
19 count++;
20 return new C248b();
21 }
22 }
23
24 class C248
25 {
26 C248a sym;
27
28 this()
29 {
30 this.sym = new C248a();
31 }
32
33 bool isintegral()
34 {
35 return sym.getMemtype().isintegral();
36 }
37 }
38
39 void main()
40 {
41 C248 e = new C248();
42 e.isintegral();
43 assert(e.sym.count == 1);
44 }