aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 0846f0c..d1f06fd 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -3893,13 +3893,12 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok,
}
else
{
- location_t last_tok_loc;
+ location_t last_tok_loc = tok->location;
gcc_obstack_init (&str_ob);
count = 0;
do
{
- last_tok_loc = tok->location;
cp_lexer_consume_token (parser->lexer);
count++;
str.text = (const unsigned char *)TREE_STRING_POINTER (string_tree);
@@ -3931,13 +3930,19 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok,
if (type == CPP_STRING)
type = curr_type;
else if (curr_type != CPP_STRING)
- error_at (tok->location,
- "unsupported non-standard concatenation "
- "of string literals");
+ {
+ rich_location rich_loc (line_table, tok->location);
+ rich_loc.add_range (last_tok_loc, false);
+ error_at_rich_loc (&rich_loc,
+ "unsupported non-standard concatenation "
+ "of string literals");
+ }
}
obstack_grow (&str_ob, &str, sizeof (cpp_string));
+ last_tok_loc = tok->location;
+
tok = cp_lexer_peek_token (parser->lexer);
if (cpp_userdef_string_p (tok->type))
{