diff options
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 2 | ||||
-rw-r--r-- | test/PCH/cxx-templates.cpp | 6 | ||||
-rw-r--r-- | test/PCH/cxx-templates.h | 10 |
3 files changed, 17 insertions, 1 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index b746cff76e..a4301b53e8 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/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; } diff --git a/test/PCH/cxx-templates.cpp b/test/PCH/cxx-templates.cpp index 982fc67e4e..7ce247721f 100644 --- a/test/PCH/cxx-templates.cpp +++ b/test/PCH/cxx-templates.cpp @@ -62,3 +62,9 @@ namespace Test1 { } }; } + +template< typename D > +Foo< D >& Foo< D >::operator=( const Foo& other ) +{ + return *this; +} diff --git a/test/PCH/cxx-templates.h b/test/PCH/cxx-templates.h index c45e02dcb2..152e8cef54 100644 --- a/test/PCH/cxx-templates.h +++ b/test/PCH/cxx-templates.h @@ -205,3 +205,13 @@ namespace NonTypeTemplateParmContext { template<int inlineCapacity> inline bool equalIgnoringNullity(const Vector<char, inlineCapacity>& a, const String& b) { return false; } } + +// <rdar://problem/11112464> +template< typename > class Foo; + +template< typename T > +class Foo : protected T +{ + public: + Foo& operator=( const Foo& other ); +}; |