Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / eh / init-temp2.C
blob6a58dda1f97943bb6d7a85f4eb7b79092b4ae186
1 // PR c++/34196
2 // { dg-options "-O -Wuninitialized" }
4 template <class _Tp> class AutoPtr
6   _Tp* _M_ptr;
8 public:
9   explicit AutoPtr(_Tp* __p = 0)  : _M_ptr(__p) {}
11   ~AutoPtr() { delete _M_ptr; }
14 struct A
16   A() { }
17   ~A() { throw 1.0; }
20 struct B
22   virtual ~B();
25 B* f (const A &s) { throw 1; }
27 int
28 main()
30   AutoPtr<B> wt(f(A()));