https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107004
sbouchex <sbouchex at infovista dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sbouchex at infovista dot com --- Comment #6 from sbouchex <sbouchex at infovista dot com> --- The same testcase is failing on : [...] g++ --version g++ (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4) [...] [...] [root@dev-sbo-eva-ol8 CorrCommon]# g++ -std=c++20 -Wall -Wextra -Werror -pedantic -Warray-bounds -O3 -o /tmp/toto /tmp/toto.cpp In file included from /usr/include/c++/13/bits/stl_iterator.h:85, from /usr/include/c++/13/bits/stl_algobase.h:67, from /usr/include/c++/13/vector:62, from /tmp/toto.cpp:1: In function 'constexpr void std::_Construct(_Tp*, _Args&& ...) [with _Tp = int*; _Args = {}]', inlined from 'static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = int**; _Size = long unsigned int]' at /usr/include/c++/13/bits/stl_uninitialized.h:666:23, inlined from 'static constexpr _ForwardIterator std::__uninitialized_default_n_1<true>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = int**; _Size = long unsigned int]' at /usr/include/c++/13/bits/stl_uninitialized.h:660:9, inlined from 'constexpr _ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = int**; _Size = long unsigned int]' at /usr/include/c++/13/bits/stl_uninitialized.h:706:20, inlined from 'constexpr _ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = int**; _Size = long unsigned int; _Tp = int*]' at /usr/include/c++/13/bits/stl_uninitialized.h:773:44, inlined from 'constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = int*; _Alloc = std::allocator<int*>]' at /usr/include/c++/13/bits/vector.tcc:668:41, inlined from 'constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = int*; _Alloc = std::allocator<int*>]' at /usr/include/c++/13/bits/stl_vector.h:1013:21, inlined from 'void foo(std::vector<int*>&)' at /tmp/toto.cpp:7:13: /usr/include/c++/13/bits/stl_construct.h:119:7: error: array subscript 'int*[0]' is partly outside array bounds of 'unsigned char [8]' [-Werror=array-bounds=] 119 | ::new((void*)__p) _Tp(std::forward<_Args>(__args)...); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/13/x86_64-redhat-linux/bits/c++allocator.h:33, from /usr/include/c++/13/bits/allocator.h:46, from /usr/include/c++/13/vector:63: In member function '_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = int*]', inlined from 'constexpr _Tp* std::allocator< <template-parameter-1-1> >::allocate(std::size_t) [with _Tp = int*]' at /usr/include/c++/13/bits/allocator.h:198:40, inlined from 'static constexpr _Tp* std::allocator_traits<std::allocator<_Up> >::allocate(allocator_type&, size_type) [with _Tp = int*]' at /usr/include/c++/13/bits/alloc_traits.h:482:28, inlined from 'constexpr std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = int*; _Alloc = std::allocator<int*>]' at /usr/include/c++/13/bits/stl_vector.h:378:33, inlined from 'constexpr void std::vector<_Tp, _Alloc>::_M_default_append(size_type) [with _Tp = int*; _Alloc = std::allocator<int*>]' at /usr/include/c++/13/bits/vector.tcc:663:45, inlined from 'constexpr void std::vector<_Tp, _Alloc>::resize(size_type) [with _Tp = int*; _Alloc = std::allocator<int*>]' at /usr/include/c++/13/bits/stl_vector.h:1013:21, inlined from 'void foo(std::vector<int*>&)' at /tmp/toto.cpp:7:13: /usr/include/c++/13/bits/new_allocator.h:147:55: note: at offset [1, 8] into object of size 8 allocated by 'operator new' 147 | return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp))); | ^ cc1plus: all warnings being treated as errors [...]