When instantiating the definition of a member function of a class
template, introduce that member function into the template
instantiation stack. Also, add diagnostics showing the member function
within the instantiation stack and clean up the qualified-name
printing so that we get something like:

  note: in instantiation of member function 'Switch1<int, 2, 2>::f'
  requested here

in the template instantiation backtrace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72015 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 79d7e2c..47388ac 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -2340,11 +2340,8 @@
   // instantiation.
   if (SpecializationRequiresInstantiation)
     InstantiateClassTemplateSpecialization(Specialization, true);
-  else {
-    // Instantiate the members of this class template specialization.
-    InstantiatingTemplate Inst(*this, TemplateLoc, Specialization);
+  else // Instantiate the members of this class template specialization.
     InstantiateClassTemplateSpecializationMembers(TemplateLoc, Specialization);
-  }
 
   return DeclPtrTy::make(Specialization);
 }
@@ -2405,12 +2402,9 @@
                                     getTemplateInstantiationArgs(Record),
                                     /*ExplicitInstantiation=*/true))
       return true;
-  } else {
-    // Instantiate all of the members of class.
-    InstantiatingTemplate Inst(*this, TemplateLoc, Record);
+  } else // Instantiate all of the members of class.
     InstantiateClassMembers(TemplateLoc, Record, 
                             getTemplateInstantiationArgs(Record));
-  }
 
   // FIXME: We don't have any representation for explicit instantiations of
   // member classes. Such a representation is not needed for compilation, but it