aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-07-30 15:16:23 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-07-30 15:16:23 -0400
commite8fa381741bd504e42221463d18d0dae9eae4832 (patch)
tree639629fb15a8a6fbdbe85523b603f9b3aa9edbff /gcc/c-family
parente2e34ed0c93f2e1180f98f3d86df96884d51c8d1 (diff)
downloadgcc-e8fa381741bd504e42221463d18d0dae9eae4832.zip
gcc-e8fa381741bd504e42221463d18d0dae9eae4832.tar.gz
gcc-e8fa381741bd504e42221463d18d0dae9eae4832.tar.bz2
c-pretty-print.c (unary_expression): Don't print '*' for reference decay.
* c-pretty-print.c (unary_expression) [INDIRECT_REF]: Don't print '*' for reference decay. From-SVN: r226410
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-pretty-print.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index d895394..9ab9551 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-30 Jason Merrill <jason@redhat.com>
+
+ * c-pretty-print.c (unary_expression) [INDIRECT_REF]: Don't print
+ '*' for reference decay.
+
2015-07-30 Marek Polacek <polacek@redhat.com>
* c-common.c (warn_tautological_cmp): Bail for float types.
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index d1a0e12..90f8c3d 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -1774,7 +1774,13 @@ c_pretty_printer::unary_expression (tree e)
if (code == ADDR_EXPR && TREE_CODE (TREE_OPERAND (e, 0)) != STRING_CST)
pp_ampersand (this);
else if (code == INDIRECT_REF)
- pp_c_star (this);
+ {
+ tree type = TREE_TYPE (TREE_OPERAND (e, 0));
+ if (type && TREE_CODE (type) == REFERENCE_TYPE)
+ /* Reference decay is implicit, don't print anything. */;
+ else
+ pp_c_star (this);
+ }
else if (code == NEGATE_EXPR)
pp_minus (this);
else if (code == BIT_NOT_EXPR || code == CONJ_EXPR)