When comparing template parameter lists, distinguish between three cases:
  - Comparing template parameter lists to determine if we have a redeclaration
  - Comparing template parameter lists to determine if we have equivalent
    template template parameters
  - Comparing template parameter lists to determine whether a template 
    template argument is valid for a given template template parameter.

Previously, we did not distinguish between the last two cases, which
got us into trouble when we were looking for exact type matches
between the types of non-type template parameters that were dependent
types. Now we do, so we properly delay checking of template template
arguments until instantiation time.

Also, fix an accidental fall-through in a case statement that was
causing crashes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86992 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 69e5a52..3f3627d 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -350,7 +350,7 @@
     if (NewTemplate &&
         (!TemplateParameterListsAreEqual(NewTemplate->getTemplateParameters(),
                                          OldTemplate->getTemplateParameters(),
-                                         false, false, SourceLocation()) ||
+                                         false, TPL_TemplateMatch) ||
          OldType->getResultType() != NewType->getResultType()))
       return true;