Fix a crash in diagnostic printing when a template class type is diff'ed
against itself. PR14489.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170474 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp
index 7d01f46..e7a8048 100644
--- a/test/Misc/diag-template-diffing.cpp
+++ b/test/Misc/diag-template-diffing.cpp
@@ -800,6 +800,18 @@
   // CHECK-ELIDE-NOTREE: error: no viable conversion from 'X<[...], 2>' to 'X<[...], 3UL>'
 }
 
+namespace PR14489 {
+  // The important thing here is that the diagnostic diffs a template specialization
+  // with no arguments against itself.  (We might need a different test if this
+  // diagnostic changes).
+  template<class ...V>
+  struct VariableList   {
+    void ConnectAllToAll(VariableList<>& params = VariableList<>())    {
+    }
+  };
+  // CHECK-ELIDE-NOTREE: non-const lvalue reference to type 'VariableList<>' cannot bind to a temporary of type 'VariableList<>'
+}
+
 // CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
 // CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
 // CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.