forked from OSchip/llvm-project
Add an assertion and a test case, in a fruitless attempt to track down an existing bug
llvm-svn: 81885
This commit is contained in:
parent
c25359e1a3
commit
31fae89497
|
@ -1244,6 +1244,9 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate,
|
|||
if (!Specialization)
|
||||
return TDK_SubstitutionFailure;
|
||||
|
||||
assert(Specialization->getPrimaryTemplate()->getCanonicalDecl() ==
|
||||
FunctionTemplate->getCanonicalDecl());
|
||||
|
||||
// If the template argument list is owned by the function template
|
||||
// specialization, release it.
|
||||
if (Specialization->getTemplateSpecializationArgs() == DeducedArgumentList)
|
||||
|
|
|
@ -26,3 +26,23 @@ void test_X0(int i, float f) {
|
|||
|
||||
X0 x0g(f, &i); // expected-error{{no matching constructor}}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct X1 {
|
||||
X1(const X1&);
|
||||
template<typename U> X1(const X1<U>&);
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct Outer {
|
||||
typedef X1<T> A;
|
||||
|
||||
A alloc;
|
||||
|
||||
explicit Outer(const A& a) : alloc(a) { }
|
||||
};
|
||||
|
||||
void test_X1(X1<int> xi) {
|
||||
Outer<int> oi(xi);
|
||||
Outer<float> of(xi);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue