FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / temporary4.C
blobbb7e56f1a75b3b2cfc3c02a46a67903c1903133a
1 // Bug: g++ initializes both B::i and B::j before destroying any temps.
3 extern "C" int printf (const char *, ...);
5 int c = 0;
6 int d = 0;
7 int r = 0;
9 struct A {
10   A() { if (c != d) r = 1; ++c; }
11   A(const A&);  // declare so g++ returns A on the stack
12   ~A() { ++d; }
13   operator int () { return 0; }
16 A foo ()
18   return A();
21 struct B {
22   int i;
23   int j;
24   B(): i(foo()), j(foo()) { }
27 int main()
29   B b;
30   return r;