Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / init / array12.C
blob3bb48002967825cf4e0f1c9d11a635e93cb92627
1 // PR c++/12253
2 // Bug: We were failing to destroy the temporary A passed to the
3 // constructor for b[0] before going on to construct b[1].
5 // { dg-do run }
7 extern "C" int printf (const char *, ...);
9 int c;
10 int r;
12 struct A
14   A() { printf ("A()\n"); if (c++) r = 1; }
15   A(const A&) { printf ("A(const A&)\n"); ++c; }
16   ~A() { printf ("~A()\n"); --c; }
19 struct B
21   B(int, const A& = A()) { printf ("B()\n"); }
24 int main()
26   B b[] = { 0, 0 };
27   return r;