summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp2
-rw-r--r--clang/test/PCH/cxx_exprs.cpp6
-rw-r--r--clang/test/PCH/cxx_exprs.h5
3 files changed, 12 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index baa8a0e4cd4..76a23321432 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -1619,7 +1619,7 @@ void ASTWriter::WriteDeclsBlockAbbrevs() {
//Character Literal
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // getValue
Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Location
- Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); //IsWide
+ Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // getKind
CharacterLiteralAbbrev = Stream.EmitAbbrev(Abv);
Abv = new BitCodeAbbrev();
diff --git a/clang/test/PCH/cxx_exprs.cpp b/clang/test/PCH/cxx_exprs.cpp
index 4cd9bae1fa4..01fc33a9a84 100644
--- a/clang/test/PCH/cxx_exprs.cpp
+++ b/clang/test/PCH/cxx_exprs.cpp
@@ -37,3 +37,9 @@ cxx_null_ptr_result null_ptr = nullptr;
// CXXTypeidExpr
typeid_result1 typeid_1 = 0;
typeid_result2 typeid_2 = 0;
+
+// CharacterLiteral variants
+static_assert(char_value == 97, "char_value is correct");
+static_assert(wchar_t_value == 305, "wchar_t_value is correct");
+static_assert(char16_t_value == 231, "char16_t_value is correct");
+static_assert(char32_t_value == 8706, "char32_t_value is correct");
diff --git a/clang/test/PCH/cxx_exprs.h b/clang/test/PCH/cxx_exprs.h
index 67ab4a6d34d..35db82efaee 100644
--- a/clang/test/PCH/cxx_exprs.h
+++ b/clang/test/PCH/cxx_exprs.h
@@ -81,3 +81,8 @@ CtorStruct create_CtorStruct() {
return CtorStruct(1, 3.14f); // CXXTemporaryObjectExpr
};
+// CharacterLiteral variants
+const char char_value = 'a';
+const wchar_t wchar_t_value = L'ı';
+const char16_t char16_t_value = u'ç';
+const char32_t char32_t_value = U'∂';
OpenPOWER on IntegriCloud