FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / temporary8.C
blobbb0698e2e3c88a0f42f7c795c2b06a728f6bf582
1 // Test for proper handling of temporaries in ?: exprs.
3 extern "C" int printf (const char *, ...);
4 int c = 0, d = 0;
6 class A {
7 public:
8   A() { ++c; }
9   A(const A&) { ++c; }
10   ~A() { ++d; }
13 A f (const A& a)
15   return (c ? A() : A());
18 int main()
20   {
21     f (c ? A() : A());
22   }
23   printf ("%d %d\n", c, d);
24   return c != d || c != 2;