Permit explicit specialization of member functions of class templates
that are declarations (rather than definitions). Also, be sure to set
the access specifiers properly when instantiating the declarations of
member function templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83911 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 503d318..916e443 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -431,7 +431,9 @@
 
   // Link the instantiated function template declaration to the function
   // template from which it was instantiated.
-  FunctionTemplateDecl *InstTemplate = InstMethod->getDescribedFunctionTemplate();
+  FunctionTemplateDecl *InstTemplate 
+    = InstMethod->getDescribedFunctionTemplate();
+  InstTemplate->setAccess(D->getAccess());
   assert(InstTemplate && "VisitCXXMethodDecl didn't create a template!");
   InstTemplate->setInstantiatedFromMemberTemplate(D);
   Owner->addDecl(InstTemplate);