https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120575
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:35d6f55f7d6655a8683b45286283d44674fa997e commit r16-2024-g35d6f55f7d6655a8683b45286283d44674fa997e Author: Jason Merrill <ja...@redhat.com> Date: Fri Jul 4 05:15:00 2025 -0400 c++: -Wtemplate-body and tentative parsing [PR120575] Here we were asserting non-zero errorcount, which is not the case if the parse error was reduced to a warning (or silenced) in a template body. So check seen_error instead. PR c++/120575 PR c++/116064 gcc/cp/ChangeLog: * parser.cc (cp_parser_abort_tentative_parse): Check seen_error instead of errorcount. gcc/testsuite/ChangeLog: * g++.dg/template/permissive-error3.C: New test.