[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / eh / elide1.C
blob94d2a6982ce1a7f6ca7b903c08d0e4031be060c6
1 // PR c++/13944
3 // Bug: When eliding the copy from the A temporary into the exception
4 // object, we extended the throw prohibition to the constructor for the
5 // temporary.  This is wrong; the throw from A() should propagate normally
6 // regardless of the elision of the temporary.
8 // { dg-do run }
10 struct A
12   A() { throw 0; }
15 int main()
17   try
18     {
19       throw A();
20     }
21   catch(int i)
22     {
23       return i;
24     }
25   catch (...)
26     {
27       return 2;
28     }
29   return 3;