Author: rsmith Date: Wed Jun 6 09:36:56 2018 New Revision: 334106 URL: http://llvm.org/viewvc/llvm-project?rev=334106&view=rev Log: 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. Modified: cfe/trunk/lib/AST/ASTContext.cpp cfe/trunk/test/SemaTemplate/dependent-names.cpp Modified: cfe/trunk/lib/AST/ASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=334106&r1=334105&r2=334106&view=diff ============================================================================== --- cfe/trunk/lib/AST/ASTContext.cpp (original) +++ cfe/trunk/lib/AST/ASTContext.cpp Wed Jun 6 09:36:56 2018 @@ -7292,6 +7292,7 @@ ASTContext::getOverloadedTemplateName(Un 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; Modified: cfe/trunk/test/SemaTemplate/dependent-names.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/dependent-names.cpp?rev=334106&r1=334105&r2=334106&view=diff ============================================================================== --- cfe/trunk/test/SemaTemplate/dependent-names.cpp (original) +++ cfe/trunk/test/SemaTemplate/dependent-names.cpp Wed Jun 6 09:36:56 2018 @@ -447,3 +447,15 @@ namespace DependentUnresolvedUsingTempla 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>(); } +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits