diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-03-26 15:52:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-03-26 15:52:37 +0000 |
commit | 9f21889a7d5b0782ca2335833fa5bc38abdaa45c (patch) | |
tree | 9289e93dc57d709f744d13bdeb9c516d89fd88a8 /clang/lib/Serialization/ASTWriter.cpp | |
parent | e6f5123e16debe7b6894827aec14f42ecddd89bf (diff) | |
download | bcm5719-llvm-9f21889a7d5b0782ca2335833fa5bc38abdaa45c.tar.gz bcm5719-llvm-9f21889a7d5b0782ca2335833fa5bc38abdaa45c.zip |
Canonicalize the declaration we write to a PCH file for an
InjectedClassNameType; otherwise, it won't be properly wired to the
original (canonical) declaration when it is deserialized. Fixes
<rdar://problem/11112464>.
llvm-svn: 153442
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index b746cff76e2..a4301b53e87 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -365,7 +365,7 @@ void ASTTypeWriter::VisitElaboratedType(const ElaboratedType *T) { } void ASTTypeWriter::VisitInjectedClassNameType(const InjectedClassNameType *T) { - Writer.AddDeclRef(T->getDecl(), Record); + Writer.AddDeclRef(T->getDecl()->getCanonicalDecl(), Record); Writer.AddTypeRef(T->getInjectedSpecializationType(), Record); Code = TYPE_INJECTED_CLASS_NAME; } |