diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-05 00:17:44 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-05 00:17:44 +0000 |
| commit | 7ba85c3e78f9d676b546c6d44a90005c7ba3ef03 (patch) | |
| tree | 5a30b12e39a4896c421901f22fee7cf0bf294bde /clang/test/SemaCXX/constexpr-printing.cpp | |
| parent | 09ffc9b47385f7965bbd2d6bcc646221ab1ff704 (diff) | |
| download | bcm5719-llvm-7ba85c3e78f9d676b546c6d44a90005c7ba3ef03.tar.gz bcm5719-llvm-7ba85c3e78f9d676b546c6d44a90005c7ba3ef03.zip | |
Fix assertions and wrong output from StmtPrinter's string literal printing.
String literals (including unicode ones) can contain non-Unicode codepoints
if they were written using \x or similar. Write those out using \x, but be
careful that the following character can't be misinterpreted as part of the
\x escape sequence. Convert UTF-16 surrogate pairs back to codepoints before
rendering them.
llvm-svn: 154069
Diffstat (limited to 'clang/test/SemaCXX/constexpr-printing.cpp')
| -rw-r--r-- | clang/test/SemaCXX/constexpr-printing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/constexpr-printing.cpp b/clang/test/SemaCXX/constexpr-printing.cpp index 4e5bc429dbd..fc0cce25eb8 100644 --- a/clang/test/SemaCXX/constexpr-printing.cpp +++ b/clang/test/SemaCXX/constexpr-printing.cpp @@ -85,8 +85,8 @@ constexpr char16_t c16 = get(u"test\0\\\"\t\a\b\234\u1234"); // \ expected-error {{}} expected-note {{u"test\000\\\"\t\a\b\234\u1234"}} constexpr char32_t c32 = get(U"test\0\\\"\t\a\b\234\u1234\U0010ffff"); // \ expected-error {{}} expected-note {{U"test\000\\\"\t\a\b\234\u1234\U0010FFFF"}} -constexpr wchar_t wc = get(L"test\0\\\"\t\a\b\234\u1234"); // \ - expected-error {{}} expected-note {{L"test\000\\\"\t\a\b\234\u1234"}} +constexpr wchar_t wc = get(L"test\0\\\"\t\a\b\234\u1234\xffffffff"); // \ + expected-error {{}} expected-note {{L"test\000\\\"\t\a\b\234\x1234\xFFFFFFFF"}} constexpr char32_t c32_err = get(U"\U00110000"); // expected-error {{invalid universal character}} |

