https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101620
Bug ID: 101620
Summary: gcc incorrectly makes concept checking in
incomplete-class context
Product: gcc
Version: 11.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
Compilation of this program
```
struct A {};
template<typename T>
concept DerivedOnceFromA = requires(T t) { { static_cast<const A&>(t) }; };
template<DerivedOnceFromA T>
struct B {};
struct C : A
{
B<C> foo();
};
```
must fail, since B<C> is checked in incomplete struct C context:
https://gcc.godbolt.org/z/ajh8MsY4n