summaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-22 18:00:39 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-22 18:00:39 +0000
commit1fe46df116a668abda78d3a61b4bd2364f771571 (patch)
tree92d85ea737af3ab701ec3aa12c9d0ae5763ee5c1 /gcc/cp/call.c
parent0f6e2c4f42a2c667e2a59dbc8af9e8ac89521e48 (diff)
downloadgcc-1fe46df116a668abda78d3a61b4bd2364f771571.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92491 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 69e06e05d42..f94526af85c 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -2333,10 +2333,18 @@ any_strictly_viable (struct z_candidate *cands)
return false;
}
+/* OBJ is being used in an expression like "OBJ.f (...)". In other
+ words, it is about to become the "this" pointer for a member
+ function call. Take the address of the object. */
+
static tree
build_this (tree obj)
{
- /* Fix this to work on non-lvalues. */
+ /* In a template, we are only concerned about the type of the
+ expression, so we can take a shortcut. */
+ if (processing_template_decl)
+ return build_address (obj);
+
return build_unary_op (ADDR_EXPR, obj, 0);
}