    DeclID FirstDeclID = ReadDeclID(Record, Idx);
    
    // 0 indicates that this declaration was the only declaration of its entity,
-@@ -1545,6 +1551,7 @@
+@@ -1545,6 +1552,7 @@
  void ASTDeclReader::mergeRedeclarable(Redeclarable<T> *D, 
                                        RedeclarableResult &Redecl) {
    // If modules are not available, there is no reason to perform this merge.

+   class AB: public virtual AA<char> {};
+   */
+
+   // template <typename T> int fwddeclThenDefinedInLeftRight(T);
+
+   // int usesfwddeclThenDefinedInLeftRightToo() {
+   //    return fwddeclThenDefinedInLeftRight((float)1); }
+
+   // template <typename T> int fwddeclThenDefinedInLeftRight(T) { return 0; }
+
+  template <typename T> int definedInLeft(T);
+
+   // template <typename T> int definedInLeftSpecializedInRight(T);
+   // template <> int definedInLeftSpecializedInRight<char>(char) { return 1; }
+   // int usesdefinedInLeftSpecializedInRightChar() {
+   //    return definedInLeftSpecializedInRight((char)0); }
+//}
Index: tools/clang/test/Modules/Inputs/redecl_templates_left.h
===================================================================

   return D;
 }
 
@@ -2275,7 +2328,7 @@
   }
   MergedDeclsMap::iterator MergedPos = combineStoredMergedDecls(CanonDecl, ID);
   if (MergedPos != MergedDecls.end())
