https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106252
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Lewis Hyatt <lhy...@gcc.gnu.org>: https://gcc.gnu.org/g:cb7b01db7a1979a45fd1dce87a8738e80568520e commit r13-1605-gcb7b01db7a1979a45fd1dce87a8738e80568520e Author: Lewis Hyatt <lhy...@gmail.com> Date: Mon Jul 11 08:12:33 2022 -0400 c-family: Fix option check in handle_pragma_diagnostic [PR106252] In r13-1544, handle_pragma_diagnostic was refactored to support processing early pragmas. During that process the part looking up option arguments was inadvertenly moved too early, prior to checking the option was valid, causing PR106252. Fixed by moving the check back where it goes. gcc/c-family/ChangeLog: PR preprocessor/106252 * c-pragma.cc (handle_pragma_diagnostic_impl): Don't look up the option argument prior to verifying the option was found.