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

llvm-svn: 124863
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 88c3a77..9db6814 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3972,7 +3972,8 @@
                                    ? TPC_FriendFunctionTemplateDefinition
                                    : TPC_FriendFunctionTemplate)
                               : (D.getCXXScopeSpec().isSet() && 
-                                 DC && DC->isRecord())
+                                 DC && DC->isRecord() && 
+                                 DC->isDependentContext())
                                   ? TPC_ClassTemplateMember
                                   : TPC_FunctionTemplate);
     }