https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128495
Bug ID: 128495
Summary: internal compiler error: tree check: expected
record_type or union_type or qual_union_type, have
pointer_type in build_op_subscript, at cp/call.cc
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: 0599jiangyc at gmail dot com
Target Milestone: ---
The following code:
```cpp
struct X { };
void foo (double *a, X x) { a[0, x]; }
```
Resulted in this output:
```
<source>:2:35: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have pointer_type in build_op_subscript, at
cp/call.cc:7842
```
Trunk reproducer (`-std=c++23`): https://godbolt.org/z/zr158GTeM