-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
c++20clang: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 party
Description
The following code fails to compile with clang trunk and clang 16 (See godbolt link).
The templated member function is not found by clang and therefore the static_assert is triggered.
The struct A inherits from T and therefore the base class member function foo exists, thus the static_assert should not trigger.
It works for non-templated base class member functions though.
struct B {
template <typename S>
void foo();
void bar();
};
template <typename T, typename S>
struct A : T {
auto foo() {
static_assert(requires { T::template foo<S>(); }); // fails with clang
static_assert(requires { T::bar(); }); // works with clang and gcc 12.2
}
};
int main() {
A<B, double> a;
a.foo();
}Metadata
Metadata
Assignees
Labels
c++20clang: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 party
Type
Projects
Status
Done