Commit da5839d6 by Roger Sayle Committed by Roger Sayle

re PR c++/21930 (pretty printer confusion)


	PR c++/21930
	* error.c (dump_expr): UNARY_PLUS_EXPR need not handle void types.
	Treat CONVERT_EXPR identically to NOP_EXPR.

	* g++.dg/other/error10.C: New test case.

From-SVN: r100865
parent bf0606af
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> 2005-06-10 Aldy Hernandez <aldyh@redhat.com>
PR c++/10611 PR c++/10611
......
...@@ -1512,14 +1512,6 @@ dump_expr (tree t, int flags) ...@@ -1512,14 +1512,6 @@ dump_expr (tree t, int flags)
break; break;
case UNARY_PLUS_EXPR: 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; break;
...@@ -1600,6 +1592,7 @@ dump_expr (tree t, int flags) ...@@ -1600,6 +1592,7 @@ dump_expr (tree t, int flags)
break; break;
case NOP_EXPR: case NOP_EXPR:
case CONVERT_EXPR:
{ {
tree op = TREE_OPERAND (t, 0); 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> 2005-06-12 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/19155 PR libfortran/19155
......
// 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" "" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment