summaryrefslogtreecommitdiff
path: root/gcc/c-pretty-print.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-26 17:04:54 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-01-26 17:04:54 +0000
commit37aea01412e930b1e509133eb4a05323b3ca6cd1 (patch)
tree6523683d3981eeb44700f6e079f5b17ecdbf08fe /gcc/c-pretty-print.c
parentc882d07f6eba04c8288c9d9adb6552ceff18bdcd (diff)
downloadgcc-37aea01412e930b1e509133eb4a05323b3ca6cd1.tar.gz
PR c++/34965
* c-pretty-print.c (pp_c_exclusive_or_expression): Handle TRUTH_XOR_EXPR. (pp_c_logical_and_expression): Handle TRUTH_AND_EXPR. (pp_c_logical_or_expression): Handle TRUTH_OR_EXPR. (pp_c_expression): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR. * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR and TRUTH_XOR_EXPR. * gcc.dg/pr34965.c: New test. * g++.dg/other/error24.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131868 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pretty-print.c')
-rw-r--r--gcc/c-pretty-print.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 5fdaf2f5e12..e9a6bbb8872 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -1,5 +1,6 @@
/* Subroutines common to both C and C++ pretty-printers.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -1737,10 +1738,14 @@ pp_c_and_expression (c_pretty_printer *pp, tree e)
static void
pp_c_exclusive_or_expression (c_pretty_printer *pp, tree e)
{
- if (TREE_CODE (e) == BIT_XOR_EXPR)
+ if (TREE_CODE (e) == BIT_XOR_EXPR
+ || TREE_CODE (e) == TRUTH_XOR_EXPR)
{
pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 0));
- pp_c_maybe_whitespace (pp);
+ if (TREE_CODE (e) == BIT_XOR_EXPR)
+ pp_c_maybe_whitespace (pp);
+ else
+ pp_c_whitespace (pp);
pp_carret (pp);
pp_c_whitespace (pp);
pp_c_and_expression (pp, TREE_OPERAND (e, 1));
@@ -1775,7 +1780,8 @@ pp_c_inclusive_or_expression (c_pretty_printer *pp, tree e)
static void
pp_c_logical_and_expression (c_pretty_printer *pp, tree e)
{
- if (TREE_CODE (e) == TRUTH_ANDIF_EXPR)
+ if (TREE_CODE (e) == TRUTH_ANDIF_EXPR
+ || TREE_CODE (e) == TRUTH_AND_EXPR)
{
pp_c_logical_and_expression (pp, TREE_OPERAND (e, 0));
pp_c_whitespace (pp);
@@ -1794,7 +1800,8 @@ pp_c_logical_and_expression (c_pretty_printer *pp, tree e)
void
pp_c_logical_or_expression (c_pretty_printer *pp, tree e)
{
- if (TREE_CODE (e) == TRUTH_ORIF_EXPR)
+ if (TREE_CODE (e) == TRUTH_ORIF_EXPR
+ || TREE_CODE (e) == TRUTH_OR_EXPR)
{
pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
pp_c_whitespace (pp);
@@ -1963,6 +1970,7 @@ pp_c_expression (c_pretty_printer *pp, tree e)
break;
case BIT_XOR_EXPR:
+ case TRUTH_XOR_EXPR:
pp_c_exclusive_or_expression (pp, e);
break;
@@ -1971,10 +1979,12 @@ pp_c_expression (c_pretty_printer *pp, tree e)
break;
case TRUTH_ANDIF_EXPR:
+ case TRUTH_AND_EXPR:
pp_c_logical_and_expression (pp, e);
break;
case TRUTH_ORIF_EXPR:
+ case TRUTH_OR_EXPR:
pp_c_logical_or_expression (pp, e);
break;