projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40daf20
)
Correct precedence for printing ?: in C++ mode.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 20 Nov 2008 06:27:03 +0000
(06:27 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Thu, 20 Nov 2008 06:27:03 +0000
(06:27 +0000)
[r23839]
ast.c
patch
|
blob
|
history
diff --git
a/ast.c
b/ast.c
index
cfec103
..
4621294
100644
(file)
--- a/
ast.c
+++ b/
ast.c
@@
-647,7
+647,8
@@
static void print_conditional(const conditional_expression_t *expression)
} else {
fputs(": ", out);
}
- print_expression_prec(expression->false_expression, PREC_CONDITIONAL);
+ precedence_t prec = c_mode & _CXX ? PREC_ASSIGNMENT : PREC_CONDITIONAL;
+ print_expression_prec(expression->false_expression, prec);
}
/**