projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
1212248
)
First bit of C++ support: Different precedence for ?:.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 26 Oct 2008 19:49:53 +0000
(19:49 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 26 Oct 2008 19:49:53 +0000
(19:49 +0000)
[r23216]
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
e8813f3
..
e749e97
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-7498,7
+7498,8
@@
static expression_t *parse_conditional_expression(expression_t *expression)
true_expression = parse_expression();
rem_anchor_token(':');
expect(':');
- expression_t *false_expression = parse_sub_expression(PREC_CONDITIONAL);
+ expression_t *false_expression =
+ parse_sub_expression(c_mode & _CXX ? PREC_ASSIGNMENT : PREC_CONDITIONAL);
type_t *const orig_true_type = true_expression->base.type;
type_t *const orig_false_type = false_expression->base.type;