Fix assert when template argument deduction's original call arg checking triggers class template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325646 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Smith 2018-02-20 23:47:12 +00:00
parent b2456f4e11
commit 799049fee5
2 changed files with 9 additions and 1 deletions

View 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();

View File

@ -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}}
}