          return FindExistingResult(Reader, D, *R.first);
      }
    }
-@@ -1798,22 +1823,38 @@
+@@ -1798,22 +1822,41 @@
  void ASTDeclReader::attachPreviousDecl(Decl *D, Decl *previous) {
    assert(D && previous);
    if (TagDecl *TD = dyn_cast<TagDecl>(D)) {

   
   // Build up the list of redeclarations.
   RedeclChainVisitor Visitor(*this, SearchDecls, RedeclsDeserialized, CanonID);
@@ -2478,3 +2526,60 @@
     }
   }
 }

===================================================================
--- tools/clang/test/Modules/Inputs/redecl_templates_left.h	(revision 0)
+++ tools/clang/test/Modules/Inputs/redecl_templates_left.h	(revision 0)
@@ -0,0 +1,31 @@
+//namespace L {
+   // template <typename T> class AA;
+   // template <typename T> class AA {};
