diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 95613b05047b0306ea3c7ef6f8b5fda774065a4c..f457d0cf019dce7a49c0ebfdf237cde4eaaef9c2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2010-09-24 Jason Merrill <jason@redhat.com> + + * error.c (dump_expr) [CASE_CONVERT]: Print conversion between + reference and pointer to the same type as "*" or "&". + 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com> * typeck.c (warn_args_num): Use warning 'too many arguments to diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 981b71f5452fef4920751b3052f3b8407e1ead6a..be3dd2c9ad18b932eb270790630cabbd4c3c32cf 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1949,8 +1949,21 @@ dump_expr (tree t, int flags) case VIEW_CONVERT_EXPR: { tree op = TREE_OPERAND (t, 0); - - if (!same_type_p (TREE_TYPE (op), TREE_TYPE (t))) + tree ttype = TREE_TYPE (t); + tree optype = TREE_TYPE (op); + + if (TREE_CODE (ttype) != TREE_CODE (optype) + && POINTER_TYPE_P (ttype) + && POINTER_TYPE_P (optype) + && same_type_p (TREE_TYPE (optype), + TREE_TYPE (ttype))) + { + if (TREE_CODE (ttype) == REFERENCE_TYPE) + dump_unary_op ("*", t, flags); + else + dump_unary_op ("&", t, flags); + } + else if (!same_type_p (TREE_TYPE (op), TREE_TYPE (t))) { /* It is a cast, but we cannot tell whether it is a reinterpret or static cast. Use the C style notation. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1917147d79d32511f721e06b957e221bd2bce4c0..659dab282b99a09997a71b5b6b08c4670ee94901 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-09-24 Jason Merrill <jason@redhat.com> + + * g++.dg/other/error10.C: Adjust expected output. + 2010-09-24 Jakub Jelinek <jakub@redhat.com> PR middle-end/45234 diff --git a/gcc/testsuite/g++.dg/other/error10.C b/gcc/testsuite/g++.dg/other/error10.C index 9e6da6529aa39983b7878e029c5c0059696d520a..26f7ca53f293c4d6cddfaa2d53cdb1ba60e314e7 100644 --- a/gcc/testsuite/g++.dg/other/error10.C +++ b/gcc/testsuite/g++.dg/other/error10.C @@ -6,7 +6,7 @@ template<int> struct A {}; template<int N> void foo(const A<N> &a) -{ -A<N>(a); } // { dg-error "\\(\\(const A<0>\\*\\)a\\)" "" } +{ -A<N>(a); } // { dg-error "\\(\\* & a\\)" "" } void bar() {