+2005-06-12 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/21930
+ * error.c (dump_expr): UNARY_PLUS_EXPR need not handle void types.
+ Treat CONVERT_EXPR identically to NOP_EXPR.
+
2005-06-10 Aldy Hernandez <aldyh@redhat.com>
PR c++/10611
break;
case UNARY_PLUS_EXPR:
- if (TREE_TYPE (t) && VOID_TYPE_P (TREE_TYPE (t)))
- {
- pp_cxx_left_paren (cxx_pp);
- dump_type (TREE_TYPE (t), flags);
- pp_cxx_right_paren (cxx_pp);
- dump_expr (TREE_OPERAND (t, 0), flags);
- }
- else
- dump_unary_op ("+", t, flags);
+ dump_unary_op ("+", t, flags);
break;
case ADDR_EXPR:
break;
case NOP_EXPR:
+ case CONVERT_EXPR:
{
tree op = TREE_OPERAND (t, 0);
+2005-06-12 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/21930
+ * g++.dg/other/error10.C: New test case.
+
2005-06-12 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/19155
--- /dev/null
+// PR c++/21930
+// Test case by Volker Reichelt
+// { dg-do compile }
+
+template<int> struct A {};
+
+template<int N>
+void foo(const A<N> &a)
+{ -A<N>(a); } // { dg-error "\\(\\(const A<0>\\*\\)a\\)" "" }
+
+void bar()
+{
+ foo(A<0>()); // { dg-error "instantiated from here" "" }
+}
+