-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 conceptsconfirmedVerified by a second partyVerified by a second partydiverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issueregression:16Regression in 16 releaseRegression in 16 release
Description
Example code could be found below or on godbolt. clang 16 and later versions complain that constraints of Base::bar is not satisfied. clang 15, gcc and MSVC all compile fine.
#include <utility>
struct S {
void baz(auto) const& {}
};
template<typename T>
struct Base {
T m_t;
int m_n;
template<auto mem_fn, typename... Args>
void bar(Args&&... args) & requires requires { // clang 16 and later versions: candidate template ignored: constraints not satisfied
mem_fn(m_t, m_n, std::forward<Args>(args)...);
} {
mem_fn(m_t, m_n, std::forward<Args>(args)...);
}
};
template<typename T>
struct Derived: Base<T> {
void foo() & {
[&](auto) { // problem goes away if auto -> int
this->template bar<[](auto& t, auto&&... args) {
t.baz(std::forward<decltype(args)>(args)...);
}>();
}(3);
}
};
void test(Derived<S>& d) {
d.foo();
}Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsC++20 conceptsconfirmedVerified by a second partyVerified by a second partydiverges-from:gccDoes the clang frontend diverge from gcc on this issueDoes the clang frontend diverge from gcc on this issueregression:16Regression in 16 releaseRegression in 16 release
Type
Projects
Status
No status