Skip to content

Commit c7b2fde

Browse files
committed
Reapply "[Clang] Profile singly-resolved UnresolvedLookupExpr with the declaration" (#140655)
This reverts commit 383e5f3.
1 parent 6181f4f commit c7b2fde

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ Bug Fixes to C++ Support
741741
- Fixed the handling of pack indexing types in the constraints of a member function redeclaration. (#GH138255)
742742
- Clang now correctly parses arbitrary order of ``[[]]``, ``__attribute__`` and ``alignas`` attributes for declarations (#GH133107)
743743
- Fixed a crash when forming an invalid function type in a dependent context. (#GH138657) (#GH115725) (#GH68852)
744+
- Fixed a function declaration mismatch that caused inconsistencies between concepts and variable template declarations. (#GH139476)
744745
- Clang no longer segfaults when there is a configuration mismatch between modules and their users (http://crbug.com/400353616).
745746
- Fix an incorrect deduction when calling an explicit object member function template through an overload set address.
746747
- Fixed bug in constant evaluation that would allow using the value of a

clang/lib/AST/StmtProfile.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,7 +2189,10 @@ StmtProfiler::VisitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *S) {
21892189

21902190
void StmtProfiler::VisitOverloadExpr(const OverloadExpr *S) {
21912191
VisitExpr(S);
2192-
VisitNestedNameSpecifier(S->getQualifier());
2192+
if (S->getNumDecls() == 1)
2193+
VisitDecl(*S->decls_begin());
2194+
else
2195+
VisitNestedNameSpecifier(S->getQualifier());
21932196
VisitName(S->getName(), /*TreatAsDecl*/ true);
21942197
ID.AddBoolean(S->hasExplicitTemplateArgs());
21952198
if (S->hasExplicitTemplateArgs())

clang/test/SemaTemplate/concepts-out-of-line-def.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,3 +853,18 @@ template <int... Ts>
853853
requires C<Ts...[0]>
854854
auto TplClass<int>::buggy() -> void {}
855855
}
856+
857+
namespace GH139476 {
858+
859+
namespace moo {
860+
template <typename T>
861+
constexpr bool baa = true;
862+
863+
template <typename T> requires baa<T>
864+
void caw();
865+
}
866+
867+
template <typename T> requires moo::baa<T>
868+
void moo::caw() {}
869+
870+
}

0 commit comments

Comments
 (0)