aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Type.h1
-rw-r--r--lib/AST/TypeSerialization.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 952a5dd9ba..5d764894c2 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -394,6 +394,7 @@ public:
private:
QualType getCanonicalTypeInternal() const { return CanonicalType; }
friend class QualType;
+ friend class TypedefType;
public:
void dump() const;
virtual void getAsStringInternal(std::string &InnerString) const = 0;
diff --git a/lib/AST/TypeSerialization.cpp b/lib/AST/TypeSerialization.cpp
index 00b71b65b5..60b5c68b0c 100644
--- a/lib/AST/TypeSerialization.cpp
+++ b/lib/AST/TypeSerialization.cpp
@@ -239,7 +239,7 @@ Type* TagType::CreateImpl(ASTContext& Context, Deserializer& D) {
//===----------------------------------------------------------------------===//
void TypedefType::EmitImpl(Serializer& S) const {
- S.Emit(QualType((Type*)this,0)/*.getCanonicalType()*/);
+ S.Emit(getCanonicalTypeInternal());
S.EmitPtr(Decl);
}
@@ -247,7 +247,7 @@ Type* TypedefType::CreateImpl(ASTContext& Context, Deserializer& D) {
std::vector<Type*>& Types =
const_cast<std::vector<Type*>&>(Context.getTypes());
- TypedefType* T = new TypedefType(Type::TypeName, NULL,QualType::ReadVal(D));
+ TypedefType* T = new TypedefType(Type::TypeName, NULL, QualType::ReadVal(D));
Types.push_back(T);
D.ReadPtr(T->Decl); // May be backpatched.