https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117625
Bug ID: 117625
Summary: [concept] Declaration matching failed
Product: gcc
Version: 14.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: newsigma at 163 dot com
Target Milestone: ---
The following code failed to compile using gcc, but compiles fine using clang
and msvc.
Link to compiler explorer: https://godbolt.org/z/jYo969oMM
Building option: -std=c++20
GCC version: GCC 10 ~ trunk
```
enum Enum {
V
};
template<class T>
concept C = sizeof(T) == 1;
template<class, Enum> class A;
template<C T, int Length>
class B;
template<C T>
using B1 = B<T, 0>;
template<C T>
class A<B1<T>, Enum::V> {
using B2 = B1<T>;
A<B2, Enum::V> func();
};
template<C T>
A<B1<T>, Enum::V> A<B1<T>, Enum::V>::func() {
return {};
}
int main() { return 0; }
```