https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116847
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 59201 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59201&action=edit gcc15-pr116847-2.patch Untested fix on top of the previous patch. Unfortunately it regresses FAIL: g++.dg/pch/line-map-3.C -g -I. -Dwith_PCH dg-regexp 23 not found: "[^[:space:]]*: some warnings being treated as errors" The thing is that by saving/restoring m_classify_diagnostic array in addition to the history, we restore with PCH restore the -Werror=someoption -Wno-error=someotheroption state from the PCH saving command line and ignore the current one. So perhaps I should just save the other vectors (history/push_list).