summaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-24 15:13:08 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-24 15:13:08 +0000
commit913dab69ab98eaf30e5f409db4a88feeb1281d87 (patch)
tree8efc3a34511bdfb3668ce18abfd09a592bd99821 /gcc/cp/error.c
parent60778e622858f194cee57d3dfa2a4e7b9915b3f4 (diff)
downloadgcc-913dab69ab98eaf30e5f409db4a88feeb1281d87.tar.gz
* error.c (dump_expr) [CASE_CONVERT]: Print conversion between
reference and pointer to the same type as "*" or "&". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164597 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 981b71f5452..be3dd2c9ad1 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. */