diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 225ca85e18115..0ee2801766a9c 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -332,8 +332,6 @@ Bug Fixes to C++ Support our attention by an attempt to fix in (#GH77703). Fixes (#GH83385). - Fix evaluation of some immediate calls in default arguments. Fixes (#GH80630) -- Fix a crash when an explicit template argument list is used with a name for which lookup - finds a non-template function and a dependent using declarator. - Fixed an issue where the ``RequiresExprBody`` was involved in the lambda dependency calculation. (#GH56556), (#GH82849). - Fix a bug where overload resolution falsely reported an ambiguity when it was comparing diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 910d0dfbf9f65..1f4a041e88dff 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -1110,9 +1110,7 @@ Sema::NameClassification Sema::ClassifyName(Scope *S, CXXScopeSpec &SS, // unqualified-id followed by a < and name lookup finds either one // or more functions or finds nothing. if (!IsFilteredTemplateName) - FilterAcceptableTemplateNames(Result, - /*AllowFunctionTemplates=*/true, - /*AllowDependent=*/true); + FilterAcceptableTemplateNames(Result); bool IsFunctionTemplate; bool IsVarTemplate; @@ -1122,7 +1120,6 @@ Sema::NameClassification Sema::ClassifyName(Scope *S, CXXScopeSpec &SS, Template = Context.getOverloadedTemplateName(Result.begin(), Result.end()); } else if (!Result.empty()) { - assert(!Result.isUnresolvableResult()); auto *TD = cast(getAsTemplateNameDecl( *Result.begin(), /*AllowFunctionTemplates=*/true, /*AllowDependent=*/false)); diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 7e91815c2d52a..83eee83aa6cad 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -491,20 +491,18 @@ bool Sema::LookupTemplateName(LookupResult &Found, // To keep our behavior consistent, we apply the "finds nothing" part in // all language modes, and diagnose the empty lookup in ActOnCallExpr if we // successfully form a call to an undeclared template-id. - bool AnyFunctions = - getLangOpts().CPlusPlus20 && llvm::any_of(Found, [](NamedDecl *ND) { + bool AllFunctions = + getLangOpts().CPlusPlus20 && llvm::all_of(Found, [](NamedDecl *ND) { return isa(ND->getUnderlyingDecl()); }); - if (AnyFunctions || (Found.empty() && !IsDependent)) { + if (AllFunctions || (Found.empty() && !IsDependent)) { // If lookup found any functions, or if this is a name that can only be // used for a function, then strongly assume this is a function // template-id. *ATK = (Found.empty() && Found.getLookupName().isIdentifier()) ? AssumedTemplateKind::FoundNothing : AssumedTemplateKind::FoundFunctions; - FilterAcceptableTemplateNames(Found, - /*AllowFunctionTemplates*/ true, - /*AllowDependent*/ true); + Found.clear(); return false; } } diff --git a/clang/test/SemaTemplate/unqual-unresolved-using-value.cpp b/clang/test/SemaTemplate/unqual-unresolved-using-value.cpp deleted file mode 100644 index 688e7a0a10b77..0000000000000 --- a/clang/test/SemaTemplate/unqual-unresolved-using-value.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s - -template -struct A : T { - using T::f; - using T::g; - using T::h; - - void f(); - void g(); - - void i() { - f(); - g(); // expected-error{{no member named 'g' in 'A'}} - h(); // expected-error{{expected '(' for function-style cast or type construction}} - // expected-error@-1{{expected expression}} - } -}; - -struct B { - template - void f(); - - void g(); - - template - void h(); -}; - -template struct A; // expected-note{{in instantiation of member function 'A::i' requested here}}