mirror of https://github.com/microsoft/clang.git
PR37680: fix faulty assertion condition.
When looking up a template name, we can find an overload set containing a function template and an unresolved non-type using declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334106 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
88a9296de1
commit
29aed5067f
|
@ -7292,6 +7292,7 @@ ASTContext::getOverloadedTemplateName(UnresolvedSetIterator Begin,
|
|||
for (UnresolvedSetIterator I = Begin; I != End; ++I) {
|
||||
NamedDecl *D = *I;
|
||||
assert(isa<FunctionTemplateDecl>(D) ||
|
||||
isa<UnresolvedUsingValueDecl>(D) ||
|
||||
(isa<UsingShadowDecl>(D) &&
|
||||
isa<FunctionTemplateDecl>(D->getUnderlyingDecl())));
|
||||
*Storage++ = D;
|
||||
|
|
|
@ -447,3 +447,15 @@ namespace DependentUnresolvedUsingTemplate {
|
|||
xb.h(); // expected-note {{instantiation of}}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PR37680 {
|
||||
template <class a> struct b : a {
|
||||
using a::add;
|
||||
template<int> int add() { return this->template add(0); }
|
||||
};
|
||||
struct a {
|
||||
template<typename T = void> int add(...);
|
||||
void add(int);
|
||||
};
|
||||
int f(b<a> ba) { return ba.add<0>(); }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue