Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ Bug Fixes in This Version
nested scopes. (#GH147495)
- Fixed a failed assertion with an operator call expression which comes from a
macro expansion when performing analysis for nullability attributes. (#GH138371)
- Fixed a concept equivalent checking crash due to untransformed constraint expressions. (#GH146614)

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
5 changes: 5 additions & 0 deletions clang/lib/Sema/SemaConcept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,12 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction(
ND && ND->isFunctionOrFunctionTemplate()) {
ScopeForParameters.emplace(S, /*CombineWithOuterScope=*/true);
const FunctionDecl *FD = ND->getAsFunction();
if (FunctionTemplateDecl *Template = FD->getDescribedFunctionTemplate();
Template && Template->getInstantiatedFromMemberTemplate())
FD = Template->getInstantiatedFromMemberTemplate()->getTemplatedDecl();
for (auto *PVD : FD->parameters()) {
if (ScopeForParameters->getInstantiationOfIfExists(PVD))
continue;
if (!PVD->isParameterPack()) {
ScopeForParameters->InstantiatedLocal(PVD, PVD);
continue;
Expand Down
21 changes: 21 additions & 0 deletions clang/test/SemaTemplate/concepts-using-decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,24 @@ void func() {
f.foo<10, 10>(); // expected-error {{no matching member function for call to 'foo'}}
}
} // namespace heads_without_concepts.

namespace GH146614 {

template <typename T>
struct base {
template <typename A>
void foo(A x)
requires (requires{x;})
{}
};


struct child : base<int> {
using base<int>::foo;
template <typename A>
void foo(A x)
requires (false)
{}
};

}