]> granicus.if.org Git - clang/commitdiff
Fix assert when template argument deduction's original call arg checking triggers...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 20 Feb 2018 23:47:12 +0000 (23:47 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 20 Feb 2018 23:47:12 +0000 (23:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325646 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateDeduction.cpp
test/SemaTemplate/temp_arg_pack.cpp [new file with mode: 0644]

index d09cf9933ecf46f92f23f685f8f9cc3d27deddb9..53fa8745ee0e8083d63e36b281776ef001ab44c8 100644 (file)
@@ -3084,7 +3084,7 @@ CheckOriginalCallArgDeduction(Sema &S, TemplateDeductionInfo &Info,
     return Sema::TDK_Success;
 
   if (A->isRecordType() && isSimpleTemplateIdType(OriginalParamType) &&
-      S.IsDerivedFrom(SourceLocation(), A, DeducedA))
+      S.IsDerivedFrom(Info.getLocation(), A, DeducedA))
     return Sema::TDK_Success;
 
   return Failed();
diff --git a/test/SemaTemplate/temp_arg_pack.cpp b/test/SemaTemplate/temp_arg_pack.cpp
new file mode 100644 (file)
index 0000000..b79dca7
--- /dev/null
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -verify %s
+
+namespace deduce_pack_non_pack {
+  template <typename...> class A;
+  template <typename> struct C {};
+  template <typename T> void g(C<A<T>>); // expected-note {{candidate template ignored: deduced type 'C<A<[...], (no argument)>>' of 1st parameter does not match adjusted type 'C<A<[...], int>>' of argument [with T = bool]}}
+  void h(C<A<bool, int>> &x) { g(x); } // expected-error {{no matching function}}
+}