https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113286
Bug ID: 113286
Summary: GCC accepts invalid program involving cast to
protected base class
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
The following invalid program is accepted only by gcc.
https://godbolt.org/z/73Mh9bres
```
struct A {};
struct B: public A {int stuff() {return 5;} };
struct C: protected B { using B::A; };
void call(A &) {}
int main()
{
C c;
call(c);
}
```