When determining template instantiation arguments within a function
template (not a specialization!), use the "injected" function template
arguments, which correspond to the template parameters of the function
template. This is required when substituting into the default template
parameters of template template parameters within a function template.

Fixes PR9016.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127092 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/issue150.cpp b/test/SemaTemplate/issue150.cpp
index 2cfa8c5..6124d05 100644
--- a/test/SemaTemplate/issue150.cpp
+++ b/test/SemaTemplate/issue150.cpp
@@ -91,7 +91,17 @@
     IntervalSet<T> IntervalSetT;
   };
   
+  template <class T, 
+            template<class _T, template<class> class Compare = less,
+                     class = typename interval_type_default<_T,Compare>::type,
+                     template<class> class = allocator> class IntervalSet>
+  void int40()
+  {
+    IntervalSet<T> IntervalSetT;
+  }
+
   void test() {
     ZZZ<int, interval_set> zzz;
+    int40<int, interval_set>();
   }
 }