https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125285
--- Comment #5 from Andrew Teylu <andrew.teylu at vector dot com> ---
Here is a smaller (well, more compressed) reproducer:
```
struct T { void m() {} };
struct W1 { void (T::*p_)(); W1(void (T::*p)()) : p_(p) {} void operator()(T*
u) { (u->*p_)(); } };
struct A { A(); char operator[](int); };
struct W2 { void operator()(W1& w, A) { T x; w(&x); } };
struct B { W1 w1; W2 w2; B(W1 a) : w1(a) {} void operator()() { A a; w2(w1, a);
} };
B mk(void (T::*p)()) { return B(W1(p)); }
template <class O> void run(B b) { O o; (void)o[0]; b(); }
void go() { run<A>(mk(&T::m)); }
```
Interestingly, for this one, you get the bug at O2 as well as 03 (i.e., it you
get the warning with g++-16, but not with g++-15).
While trying to reduce the above, I came across this:
```
struct Inner { void (*f)(); long d; };
struct Outer { Inner i; Outer(Inner a) : i(a) {} };
Outer mk(Inner x) { return Outer(x); }
```
With `g++-15 -O3 -fdump-tree-esra-details -c esra_witness.cpp`, you get:
```
Will attempt to totally scalarize a (UID: 2950):
Created a replacement for a offset: 0, size: 64: a$f
Created a replacement for a offset: 64, size: 64: a$d
```
but with `g++-16 -O3 -fdump-tree-esra-details -c esra_witness.cpp`, you get:
```
! Disqualifying a - No or inhibitingly overlapping accesses.
```