aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-01-02 18:14:06 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-01-02 18:14:06 +0000
commita2d8669b09363d3d3a3c67982e08a38c8ed015d0 (patch)
treedbc3cac45bf96ffce36739bbfec8e2ca932f9897 /lib
parentd07cc36c71558b62889691184dd04655a33fd12a (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/StmtPrinter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index 6408c879fa..836f192aeb 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/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]