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
This commit is contained in:
Roger Sayle 2005-06-12 23:46:46 +00:00 committed by Roger Sayle
parent bf0606afc1
commit da5839d664
4 changed files with 28 additions and 9 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -1512,15 +1512,7 @@ dump_expr (tree t, int flags)
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:
@ -1600,6 +1592,7 @@ dump_expr (tree t, int flags)
break;
case NOP_EXPR:
case CONVERT_EXPR:
{
tree op = TREE_OPERAND (t, 0);

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,15 @@
// 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" "" }
}