diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-06-20 16:37:28 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-06-20 16:37:28 +0000 |
commit | 842107e43de51855cd5870be1a67bc4eabca4a25 (patch) | |
tree | 5df2315bb993f48933d4efe20cb3866896e28adf /gcc/testsuite | |
parent | 9ee6540a77ee11d1aa70d86e08642406fb150fe0 (diff) | |
download | gcc-842107e43de51855cd5870be1a67bc4eabca4a25.zip gcc-842107e43de51855cd5870be1a67bc4eabca4a25.tar.gz gcc-842107e43de51855cd5870be1a67bc4eabca4a25.tar.bz2 |
C++ FE: Show both locations in string literal concatenation error
gcc/cp/ChangeLog:
* parser.c (cp_parser_string_literal): Convert non-standard
concatenation error to directly use a rich_location, and
use that to add the location of the first literal to the
diagnostic.
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/string-literal-concat.C: New test case.
From-SVN: r237608
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/diagnostic/string-literal-concat.C | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0570b22..1d43852 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-06-20 David Malcolm <dmalcolm@redhat.com> + + * g++.dg/diagnostic/string-literal-concat.C: New test case. + 2016-06-20 Martin Sebor <msebor@redhat.com> PR c/69507 diff --git a/gcc/testsuite/g++.dg/diagnostic/string-literal-concat.C b/gcc/testsuite/g++.dg/diagnostic/string-literal-concat.C new file mode 100644 index 0000000..4ede799 --- /dev/null +++ b/gcc/testsuite/g++.dg/diagnostic/string-literal-concat.C @@ -0,0 +1,23 @@ +/* { dg-options "-fdiagnostics-show-caret -std=c++11" } */ + +const void *s = u8"a" u"b"; // { dg-error "24: non-standard concatenation" } +/* { dg-begin-multiline-output "" } + const void *s = u8"a" u"b"; + ~~~~~ ^~~~ + { dg-end-multiline-output "" } */ + +const void *s2 = u"a" u"b" u8"c"; // { dg-error "30: non-standard concatenation" } +/* { dg-begin-multiline-output "" } + const void *s2 = u"a" u"b" u8"c"; + ~~~~ ^~~~~ + { dg-end-multiline-output "" } */ + +#define TEST_U8_LITERAL u8"a" + +const void *s3 = TEST_U8_LITERAL u8"b"; + +const void *s4 = TEST_U8_LITERAL u"b"; // { dg-error "34: non-standard concatenation" } +/* { dg-begin-multiline-output "" } + const void *s4 = TEST_U8_LITERAL u"b"; + ^~~~ + { dg-end-multiline-output "" } */ |