diff options
| author | J"orn Rennecke <joern.rennecke@st.com> | 2006-08-29 14:34:36 +0000 |
|---|---|---|
| committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2006-08-29 15:34:36 +0100 |
| commit | 2de9107ad5ea3e76fb01e7eead041901f8348cc0 (patch) | |
| tree | 54706980654f3c40de987bd6338934a3dee183b3 /gcc/cp/except.c | |
| parent | a3b6119721e9344233ac684940ea4cc0ee79e9c5 (diff) | |
| download | gcc-2de9107ad5ea3e76fb01e7eead041901f8348cc0.zip gcc-2de9107ad5ea3e76fb01e7eead041901f8348cc0.tar.gz gcc-2de9107ad5ea3e76fb01e7eead041901f8348cc0.tar.bz2 | |
re PR c++/28139 (alias information for EH is wrong)
cp:
PR c++/28139
* except.c (expand_start_catch_block): Use correct types for bitwise
copy.
testsuite:
PR c++/28139
* g++.dg/eh/alias1.C: New test.
From-SVN: r116561
Diffstat (limited to 'gcc/cp/except.c')
| -rw-r--r-- | gcc/cp/except.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 71b433f..ad493aa 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -458,7 +458,14 @@ expand_start_catch_block (tree decl) else { tree init = do_begin_catch (); - exp = create_temporary_var (ptr_type_node); + tree init_type = type; + + /* Pointers are passed by values, everything else by reference. */ + if (!TYPE_PTR_P (type)) + init_type = build_pointer_type (type); + if (init_type != TREE_TYPE (init)) + init = build1 (NOP_EXPR, init_type, init); + exp = create_temporary_var (init_type); DECL_REGISTER (exp) = 1; cp_finish_decl (exp, init, /*init_const_expr=*/false, NULL_TREE, LOOKUP_ONLYCONVERTING); |
