diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-02 18:14:06 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-02 18:14:06 +0000 |
commit | dbfd4037fccf619c08bf76abea29608cfe0eb922 (patch) | |
tree | 117efa07120b37288171eb32fb5657553f4aa0d8 /clang/lib/AST/StmtPrinter.cpp | |
parent | 8e25104b108ad0d40c144e9eeae374e3eb6607a7 (diff) | |
download | bcm5719-llvm-dbfd4037fccf619c08bf76abea29608cfe0eb922.tar.gz bcm5719-llvm-dbfd4037fccf619c08bf76abea29608cfe0eb922.zip |
Add assertion to char32_t that the value is valid, as suggested by Jordy Rose.
Add a test that such characters don't make it through to StringLiteral objects
in error recovery.
llvm-svn: 147438
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 6408c879fa2..836f192aeb1 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -717,7 +717,7 @@ void StmtPrinter::VisitStringLiteral(StringLiteral *Str) { default: // FIXME: Is this the best way to print wchar_t? if (Char > 0xff) { - // char32_t values are <= 0x10ffff. + assert(Char <= 0x10ffff && "invalid unicode codepoint"); if (Char > 0xffff) OS << "\\U00" << Hex[(Char >> 20) & 15] |