Avoid double parentheses when AST printing sizeof expressions.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 21 Dec 2008 13:06:37 +0000 (13:06 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 21 Dec 2008 13:06:37 +0000 (13:06 +0000)
[r24826]

ast.c

diff --git a/ast.c b/ast.c
index f0946ef..b893bd3 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -576,10 +576,8 @@ static void print_typeprop_expression(const typeprop_expression_t *expression)
                fputs("__alignof__", out);
        }
        if (expression->tp_expression != NULL) {
-               /* always print the '()' here, sizeof x is right but unusual */
-               fputc('(', out);
-               print_expression(expression->tp_expression);
-               fputc(')', out);
+               /* PREC_TOP: always print the '()' here, sizeof x is right but unusual */
+               print_expression_prec(expression->tp_expression, PREC_TOP);
        } else {
                fputc('(', out);
                print_type(expression->type);