summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-09 20:34:13 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-09 20:34:13 +0000
commitd5b637fa2f35fb2f4782158c349f971a46baa3bd (patch)
tree56175d390c11854aba3f0de6bda4ded498eb45a0 /gcc/c-parser.c
parentb95e89d3e25f8a7c2c7449cd6d0553c413d7a54e (diff)
downloadgcc-d5b637fa2f35fb2f4782158c349f971a46baa3bd.tar.gz
./:
* targhooks.c (default_builtin_vectorized_function): Change fn parameter to unsigned int. (default_builtin_vectorized_conversion): Change code parameter to unsigned int. (default_builtin_reciprocal): Change fn parameter to unsigned int. * targhooks.h: Update declarations. * config/rs6000/rs6000.c (rs6000_builtin_conversion): Change code parameter to unsigned int. * c-typeck.c (comptypes_check_enum_int): New static function. (comptypes_internal): Add enum_and_int_p parameter. Change all callers. (comp_target_types): Add location parameter. Change all callers. (tagged_types_tu_compatible_p): Add enum_and_int_p parameter. Change all callers. (function_types_compatible_p, type_lists_compatible_p): Likewise. (build_conditional_expr): Add colon_loc parameter. Change all callers. (convert_for_assignment): Add location parameter. Change all callers. * c-parser.c (c_parser_conditional_expression): Pass location of colon to build_conditional_expr. * c-tree.h (build_conditional_expr): Update declaration. objc/: * objc-act.c (objc_gimplify_expr): Change return type to int. * objc-act.h: Update declaration. testsuite/: * gcc.dg/Wcxx-compat-12.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 244c238023d..284708656b5 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -4503,7 +4503,7 @@ static struct c_expr
c_parser_conditional_expression (c_parser *parser, struct c_expr *after)
{
struct c_expr cond, exp1, exp2, ret;
- location_t cond_loc;
+ location_t cond_loc, colon_loc;
gcc_assert (!after || c_dialect_objc ());
@@ -4542,6 +4542,8 @@ c_parser_conditional_expression (c_parser *parser, struct c_expr *after)
skip_evaluation += ((cond.value == truthvalue_true_node)
- (cond.value == truthvalue_false_node));
}
+
+ colon_loc = c_parser_peek_token (parser)->location;
if (!c_parser_require (parser, CPP_COLON, "expected %<:%>"))
{
skip_evaluation -= cond.value == truthvalue_true_node;
@@ -4553,7 +4555,7 @@ c_parser_conditional_expression (c_parser *parser, struct c_expr *after)
exp2 = c_parser_conditional_expression (parser, NULL);
exp2 = default_function_array_conversion (exp2);
skip_evaluation -= cond.value == truthvalue_true_node;
- ret.value = build_conditional_expr (cond.value,
+ ret.value = build_conditional_expr (colon_loc, cond.value,
cond.original_code == C_MAYBE_CONST_EXPR,
exp1.value, exp2.value);
ret.original_code = ERROR_MARK;