https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99418
--- Comment #8 from Ivan Sorokin <vanyacpp at gmail dot com> --- If I understand #c5 correctly the minimal reproducer should be this: void g(int&); void f() { int a[10]; int& p = a[10]; // (1) g(a[10]); // (2) } Both (1) and (2) are undefined and -fsanitize=bounds can help checking this.