https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102006
--- Comment #10 from Martin Sebor <msebor at gcc dot gnu.org> --- With the reduced test case from attachment 51366 I get the same warning: $ gcc -O2 -S -Wall -std=c++20 -xc++ ListTest.cpp.i In constructor ‘double_iterator<T, DLink, ForwardLink, BackwardLink>::double_iterator(single_iterator<T, ForwardLink>) [with T = Element; DLink = quick_link; ForwardLink = forward_link<quick_link>; BackwardLink = backward_link<quick_link>]’, inlined from ‘quick_list<T, DLink>::iterator quick_list<T, DLink>::end() [with T = Element; DLink = quick_link]’ at ListTest.cpp.i:66:43, inlined from ‘void ListHolder::PrintList()’ at ListTest.cpp.i:92:73, inlined from ‘void List_TestFunc(const TestContext&)’ at ListTest.cpp.i:103:19: ListTest.cpp.i:30:96: warning: array subscript 0 is outside array bounds of ‘ListHolder [1]’ [-Warray-bounds] 30 | ator<T, ForwardLink> i) : double_iterator(static_cast<DLink *>(*i)) { } | ^ ListTest.cpp.i: In function ‘void List_TestFunc(const TestContext&)’: ListTest.cpp.i:102:14: note: at offset -16 into object ‘holder’ of size 16 102 | ListHolder holder (context); | ^~~~~~