+2004-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ 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.
+
2005-04-25 Roger Sayle <roger@eyesopen.com>
Mark Mitchell <mark@codesourcery.com>
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);
}
for certain kinds of expressions which are not really lvalues
but which we can accept as lvalues.
- If ARG is not a kind of expression we can handle, return zero. */
+ If ARG is not a kind of expression we can handle, return
+ NULL_TREE. */
tree
unary_complex_lvalue (enum tree_code code, tree arg)
{
+ /* Inside a template, making these kinds of adjustments is
+ pointless; we are only concerned with the type of the
+ expression. */
+ if (processing_template_decl)
+ return NULL_TREE;
+
/* Handle (a, b) used as an "lvalue". */
if (TREE_CODE (arg) == COMPOUND_EXPR)
{
+2004-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/18464
+ * g++.dg/template/cond5.C: New test.
+
2005-05-01 Joseph S. Myers <joseph@codesourcery.com>
PR c/21213