aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-04-12 10:38:03 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-04-12 10:38:03 +0000
commitdf1550fc59b51681d37225934fe4e3acac321621 (patch)
tree045cee9183d002dc4ad71f4e406564f55c8aeb7d /lib/Serialization/ASTWriter.cpp
parent9d5d308c9be367ec41cc6a89f215d45f675b4617 (diff)
Fix AST serialization of reference-to-reference types. This previously caused
a crash when deserializing the AST for this: typedef char (&R); extern R &r; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index f0f5347a16..f7dfc38224 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -105,12 +105,13 @@ void ASTTypeWriter::VisitBlockPointerType(const BlockPointerType *T) {
}
void ASTTypeWriter::VisitLValueReferenceType(const LValueReferenceType *T) {
- Writer.AddTypeRef(T->getPointeeType(), Record);
+ Writer.AddTypeRef(T->getPointeeTypeAsWritten(), Record);
+ Record.push_back(T->isSpelledAsLValue());
Code = TYPE_LVALUE_REFERENCE;
}
void ASTTypeWriter::VisitRValueReferenceType(const RValueReferenceType *T) {
- Writer.AddTypeRef(T->getPointeeType(), Record);
+ Writer.AddTypeRef(T->getPointeeTypeAsWritten(), Record);
Code = TYPE_RVALUE_REFERENCE;
}