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
This commit is contained in:
Jason Merrill 2015-07-30 15:16:23 -04:00 committed by Jason Merrill
parent e2e34ed0c9
commit e8fa381741
2 changed files with 12 additions and 1 deletions

View File

@ -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.

View File

@ -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)