vec<tree, va_gc> *ret;
vec<tree, va_gc> *orig_types;
struct c_expr expr;
- location_t loc = c_parser_peek_token (parser)->location;
unsigned int idx = 0;
ret = make_tree_vector ();
c_parser_check_literal_zero (parser, literal_zero_mask, 0);
expr = c_parser_expr_no_commas (parser, NULL);
if (convert_p)
- expr = convert_lvalue_to_rvalue (loc, expr, true, true);
+ expr = convert_lvalue_to_rvalue (expr.get_location (), expr, true, true);
if (fold_p)
expr.value = c_fully_fold (expr.value, false, NULL);
ret->quick_push (expr.value);
if (orig_types)
orig_types->quick_push (expr.original_type);
if (locations)
- locations->safe_push (loc);
+ locations->safe_push (expr.get_location ());
if (sizeof_arg != NULL
&& expr.original_code == SIZEOF_EXPR)
{
while (c_parser_next_token_is (parser, CPP_COMMA))
{
c_parser_consume_token (parser);
- loc = c_parser_peek_token (parser)->location;
if (literal_zero_mask)
c_parser_check_literal_zero (parser, literal_zero_mask, idx + 1);
expr = c_parser_expr_no_commas (parser, NULL);
if (convert_p)
- expr = convert_lvalue_to_rvalue (loc, expr, true, true);
+ expr = convert_lvalue_to_rvalue (expr.get_location (), expr, true,
+ true);
if (fold_p)
expr.value = c_fully_fold (expr.value, false, NULL);
vec_safe_push (ret, expr.value);
if (orig_types)
vec_safe_push (orig_types, expr.original_type);
if (locations)
- locations->safe_push (loc);
+ locations->safe_push (expr.get_location ());
if (++idx < 3
&& sizeof_arg != NULL
&& expr.original_code == SIZEOF_EXPR)
location_t get_start () const { return src_range.m_start; }
location_t get_finish () const { return src_range.m_finish; }
+ location_t get_location () const
+ {
+ if (CAN_HAVE_LOCATION_P (value))
+ return EXPR_LOCATION (value);
+ else
+ return make_location (get_start (), get_start (), get_finish ());
+ }
+
/* Set the value to error_mark_node whilst ensuring that src_range
is initialized. */
void set_error ()
+2017-08-21 David Malcolm <dmalcolm@redhat.com>
+
+ * gcc.dg/format/diagnostic-ranges.c (test_mismatching_types):
+ Update expected result to show all of "(long)0" being underlined.
+ * gcc.dg/plugin/diagnostic-test-string-literals-1.c
+ (test_multitoken_macro): Update expected underlining.
+
2017-08-21 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/format/diagnostic-ranges.c: Update expected results