diff options
author | Jason Merrill <jason@redhat.com> | 2010-09-24 11:13:08 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-09-24 11:13:08 -0400 |
commit | 75d980abcc4dbd2bcb3d06c3f12ef9312ccac856 (patch) | |
tree | 8efc3a34511bdfb3668ce18abfd09a592bd99821 /gcc/cp | |
parent | 32990d5bc27147c3f6e53324b37089b104c864cc (diff) | |
download | gcc-75d980abcc4dbd2bcb3d06c3f12ef9312ccac856.zip gcc-75d980abcc4dbd2bcb3d06c3f12ef9312ccac856.tar.gz gcc-75d980abcc4dbd2bcb3d06c3f12ef9312ccac856.tar.bz2 |
error.c (dump_expr): Print conversion between reference and pointer to the same type as "*" or "&".
* error.c (dump_expr) [CASE_CONVERT]: Print conversion between
reference and pointer to the same type as "*" or "&".
From-SVN: r164597
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/error.c | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 95613b0..f457d0c 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 981b71f..be3dd2c 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. */ |