Fix abbreviation for CharacterLiteral in AST serialization. PR13806.

llvm-svn: 163863
This commit is contained in:
Eli Friedman 2012-09-14 00:51:36 +00:00
parent aeb85680fb
commit 21530f7c4e
3 changed files with 12 additions and 1 deletions

View File

@ -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();

View File

@ -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");

View File

@ -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'';