fe586212995de927aa45398f7644d36b09a3d253
[gcc.git] / gcc / testsuite / g++.dg / tc1 / dr20.C
1 // { dg-do run }
2 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
3 // DR20: Some clarifications needed for 12.8 para 15
4
5 extern "C" void printf(const char*, ...);
6 extern "C" void abort(void);
7
8 int count = 0;
9
10 class Thing {
11 public:
12 Thing() {
13 }
14 ~Thing() {
15 }
16 Thing(const Thing&)
17 {
18 count += 1;
19 }
20 };
21
22 Thing f() {
23 Thing t;
24 return t;
25 }
26
27 int main(void)
28 {
29 Thing t2 = f();
30 printf("%d %x\n", count, &t2);
31 if (count != 0)
32 abort();
33 return 0;
34 }