diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-07-10 18:40:49 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-07-10 18:40:49 +0200 |
commit | 87e356bada28a71fd101dce4512564ff6cb8fb15 (patch) | |
tree | 0fc3c50dd67f106705eddd814b4b2176bee125ff /gcc | |
parent | bb6f2bacbb0d7133a1187bb394d5713b98a54942 (diff) | |
download | gcc-87e356bada28a71fd101dce4512564ff6cb8fb15.zip gcc-87e356bada28a71fd101dce4512564ff6cb8fb15.tar.gz gcc-87e356bada28a71fd101dce4512564ff6cb8fb15.tar.bz2 |
re PR preprocessor/57757 (CPP extra inserted whitespace needs to be reviewed for C++11 user-defined literals)
PR preprocessor/57757
* lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
starts if a-zA-Z_.
* g++.dg/cpp/paste1.C: New test.
* g++.dg/cpp/paste2.C: New test.
From-SVN: r200875
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp/paste1.C | 14 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp/paste2.C | 15 |
3 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1b4e046..82502f5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,11 @@ +2013-07-10 Jakub Jelinek <jakub@redhat.com> + + PR preprocessor/57757 + * g++.dg/cpp/paste1.C: New test. + * g++.dg/cpp/paste2.C: New test. + 2013-07-10 Graham Stott <grahams@btinternet.com> + * gcc.target/mips/mulsize-1.c: New. * gcc.target/mips/mulsize-2.c: New. * gcc.target/mips/mulsize-3.c: New. diff --git a/gcc/testsuite/g++.dg/cpp/paste1.C b/gcc/testsuite/g++.dg/cpp/paste1.C new file mode 100644 index 0000000..a33fdf5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp/paste1.C @@ -0,0 +1,14 @@ +// PR preprocessor/57757 +// { dg-do compile } +// { dg-options "-std=c++11" } + +#define S(x) x +extern S("C")void exit (int); +int +main () +{ + (void) (S("foo")and 0); + const wchar_t *p = S(L"foo")L"bar"; + const char *a = S("foo")R"(bar)"; + exit (0); +} diff --git a/gcc/testsuite/g++.dg/cpp/paste2.C b/gcc/testsuite/g++.dg/cpp/paste2.C new file mode 100644 index 0000000..89a659e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp/paste2.C @@ -0,0 +1,15 @@ +// PR preprocessor/57757 +// { dg-do compile } +// { dg-options "-std=c++11 -save-temps" } +// { dg-final cleanup-saved-temps } + +#define S(x) x +extern S("C")void exit (int); +int +main () +{ + (void) (S("foo")and 0); + const wchar_t *p = S(L"foo")L"bar"; + const char *a = S("foo")R"(bar)"; + exit (0); +} |