Tweak my fix for PR8748, and update the incorrect PR number in the test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124863 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index e867354..88ba3f9 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -947,7 +947,8 @@
   if (CheckTemplateParameterList(TemplateParams,
             PrevClassTemplate? PrevClassTemplate->getTemplateParameters() : 0,
                                  (SS.isSet() && SemanticContext &&
-                                  SemanticContext->isRecord())
+                                  SemanticContext->isRecord() &&
+                                  SemanticContext->isDependentContext())
                                    ? TPC_ClassTemplateMember
                                    : TPC_ClassTemplate))
     Invalid = true;