https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102156
Bug ID: 102156
Summary: `cannot call constructor` error during member access
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: fchelnokov at gmail dot com
Target Milestone: ---
The following valid code accesses a field in a base class:
```
struct A { int v; };
template <typename T> struct B : T {};
struct C : B<A> {};
int main() { return C{}.B::B<A>::v; }
```
but GCC prints an error:
```
cannot call constructor 'B<A>::B' directly
```
https://gcc.godbolt.org/z/hchqG7Tq8