diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index 1cf42f425d3a..785737dbbb1d 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -2710,6 +2710,9 @@ ExpectedDecl ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { getCanonicalForwardRedeclChain(D2CXX); for (auto *R : Redecls) { auto *RI = cast(R); + // Existing Decl in the chain might not have the described + // template set, so we set it now. + RI->setDescribedClassTemplate(ToDescribed); RI->setTypeForDecl(nullptr); // Below we create a new injected type and assign that to the // canonical decl, subsequent declarations in the chain will reuse