Index: clang/lib/Sema/SemaTemplateInstantiate.cpp =================================================================== --- clang/lib/Sema/SemaTemplateInstantiate.cpp +++ clang/lib/Sema/SemaTemplateInstantiate.cpp @@ -3235,6 +3235,14 @@ if (FunctionDecl *Pattern = Function->getInstantiatedFromMemberFunction()) { + if (Function->getTrailingRequiresClause()) { + ConstraintSatisfaction Satisfaction; + if (CheckFunctionConstraints(Function, Satisfaction) || + !Satisfaction.IsSatisfied) { + continue; + } + } + if (Function->hasAttr()) continue; Index: clang/test/SemaTemplate/concepts.cpp =================================================================== --- clang/test/SemaTemplate/concepts.cpp +++ clang/test/SemaTemplate/concepts.cpp @@ -169,3 +169,19 @@ template void f(T, U) = delete; void g() { f(0, 0); } } + +namespace PR46029 { +template +struct A { + void f() requires(N == 1) { + static_assert(N == 1); + } + void f() requires(N == 2) { + static_assert(N == 2); + } +}; + +template struct A<1>; +template struct A<2>; +template struct A<3>; +}