https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80641
--- Comment #10 from Paul Gotch <paulg at chiark dot greenend.org.uk> --- I'm afraid the changes made to libstdc++ have only solved part of the regression if you say something like std::vector<int> v; if(c.size() > 0) c.resize(c.size() - 1); then you no longer get a warning in 7.3 however if instead you do if(! c.empty()) c.resize(c.size() -1); the warning is produced just as in early 7.x releases. No warning is produced in 6.x so this is still a regression. I presume this happens as empty wasn't annotated in libstdc++ and the underlying data flow analysis bug is yet to be fixed.