https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366
Roy Stogner <roystgnr at ices dot utexas.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |roystgnr at ices dot utexas.edu --- Comment #11 from Roy Stogner <roystgnr at ices dot utexas.edu> --- This can even be triggered via std::vector::operator=, at least in gcc 11.2. My own code is slightly more involved than this, but I can boil it down to: std::vector<int> src(2,1), dest(2); dest = src; and that's enough to trigger this warning in a -O2 -Wall -Werror build. Oddly, if I write dest(2,0) rather than dest(2), I don't see any warning. That's a fine workaround for my own non-performance-critical code path, but I wonder if it also indicates that the underlying optimization is no longer being enabled here for code that would benefit.