FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.dg / eh / stabilize.C
blobdf47cab0cf424f50a6b206159fc8788516893049
1 // PR c++/8186
3 // Bug: In f, convert_for_arg_passing wrapped the A TARGET_EXPR in an
4 // ADDR_EXPR for passing by invisible ref.  stabilize_throw_expr copied the
5 // resulting pointer into a temporary.  cp_convert_parm_for_inlining then
6 // dereferences it and tries to initialize B::am with the INDIRECT_REF,
7 // which calls for a bitwise copy.  Which is broken.
9 // { dg-options "-O" }
11 struct A
13   A();
14   A(const A&);
15   A& operator=(const A&);
18 struct B {
19   A am;
20   B(A a) { am = a; }
23 void f ()
25   throw B(A());