aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-gimplify.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-12-22 18:00:39 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-12-22 18:00:39 +0000
commitdfb5c52315ecc5b6ebabf2d7cb3d3d69f35a378b (patch)
tree92d85ea737af3ab701ec3aa12c9d0ae5763ee5c1 /gcc/cp/cp-gimplify.c
parent606145e4e0e54d412059033a6261c53bf11d7b6d (diff)
downloadgcc-dfb5c52315ecc5b6ebabf2d7cb3d3d69f35a378b.zip
gcc-dfb5c52315ecc5b6ebabf2d7cb3d3d69f35a378b.tar.gz
gcc-dfb5c52315ecc5b6ebabf2d7cb3d3d69f35a378b.tar.bz2
re PR c++/18464 (error message about "non-lvalue in unary '&'" when using ?: operator)
PR c++/18464 * call.c (build_this): In templates, do not bother with build_unary_op. * typeck.c (unary_complex_lvalue): In a template, always refuse simplifications. PR c++/18492 * cp-gimplify.c (cp_genericize): Relax assertion. PR c++/11224 * cvt.c (convert_to_void): Warn about unused values. PR c++/18257 * rtti.c (emit_support_tinfos): On systems without weak symbols, emit the runtime library type-info objects as non-COMDAT. PR c++/18464 * g++.dg/template/cond5.C: New test. PR c++/18492 * g++.dg/inherit/thunk3.C: New test. PR c++/11224 * g++.dg/warn/Wunused-9.C: New test. From-SVN: r92491
Diffstat (limited to 'gcc/cp/cp-gimplify.c')
-rw-r--r--gcc/cp/cp-gimplify.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index d953156..413a933 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -334,17 +334,19 @@ cp_genericize (tree fndecl)
/* Fix up the types of parms passed by invisible reference. */
for (t = DECL_ARGUMENTS (fndecl); t; t = TREE_CHAIN (t))
- {
- gcc_assert (!DECL_BY_REFERENCE (t));
- if (TREE_ADDRESSABLE (TREE_TYPE (t)))
- {
- gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t));
- TREE_TYPE (t) = DECL_ARG_TYPE (t);
- DECL_BY_REFERENCE (t) = 1;
- TREE_ADDRESSABLE (t) = 0;
- relayout_decl (t);
- }
- }
+ if (TREE_ADDRESSABLE (TREE_TYPE (t)))
+ {
+ /* If a function's arguments are copied to create a thunk,
+ then DECL_BY_REFERENCE will be set -- but the type of the
+ argument will be a pointer type, so we will never get
+ here. */
+ gcc_assert (!DECL_BY_REFERENCE (t));
+ gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t));
+ TREE_TYPE (t) = DECL_ARG_TYPE (t);
+ DECL_BY_REFERENCE (t) = 1;
+ TREE_ADDRESSABLE (t) = 0;
+ relayout_decl (t);
+ }
/* Do the same for the return value. */
if (TREE_ADDRESSABLE (TREE_TYPE (DECL_RESULT (fndecl))))