https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111918
--- Comment #2 from Florian Weimer <fw at gcc dot gnu.org> --- It does not work. I think the problem is the quoted reset code with old_kind. It was introduced in r5-2858 to fix PR59304. It's necessary because global warning options serve a dual purpose: recording the command line state, and activating warning processing code (or put differently, to skip over analysis for a warning if the warning is not active). The diagnostics pragma code has to set global warnings to disable the shortcuts, but this clobbers the command line state.