https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82600
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Reduced testcase: void *b[10]; template <int N> void ** foo (int x) { void **a = b; return &a[x]; } void ** bar (int x) { return foo <0> (x); }