https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99382
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Vittorio Zecca from comment #0) > int i[3]; > Size n = {4}; > auto j = std::__uninitialized_default_n(i, n); // Fails here What part of this do you think is a bug? You've told the library to construct 4 elements in a region of storage that only has room for 3. Of course it has a buffer overflow.