Improved representation and support for friend class templates.  Angst about same.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82088 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 696c10a..9f86f12 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3957,7 +3957,11 @@
           = MatchTemplateParametersToScopeSpecifier(KWLoc, SS,
                         (TemplateParameterList**)TemplateParameterLists.get(),
                                               TemplateParameterLists.size())) {
-      if (TemplateParams->size() > 0) {
+      if (TUK == TUK_Friend) {
+        // When declaring a friend template, we do want to match the
+        // template parameters to the scope specifier, but don't go so far
+        // as to try to declare a new template.
+      } else if (TemplateParams->size() > 0) {
         // This is a declaration or definition of a class template (which may
         // be a member of another template).
         OwnedDecl = false;