https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117825
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:da82bf0a5fe31319735af1b67218578440ed8333 commit r14-11157-gda82bf0a5fe31319735af1b67218578440ed8333 Author: Jakub Jelinek <ja...@redhat.com> Date: Wed Jan 8 23:12:02 2025 +0100 c++: Honor complain in cp_build_function_call_vec for check_function_arguments warnings [PR117825] The following testcase ICEs due to re-entering diagnostics. When diagnosing -Wformat-security warning, we try to print instantiation context, which calls tsubst with tf_none, but that in the end calls cp_build_function_call_vec which calls check_function_arguments which diagnoses another warning (again -Wformat-security). The other check_function_arguments caller, build_over_call, doesn't call that function if !(complain & tf_warning), so I think the best fix is to do it the same in cp_build_function_call_vec as well. 2025-01-08 Jakub Jelinek <ja...@redhat.com> PR c++/117825 * typeck.cc (cp_build_function_call_vec): Don't call check_function_arguments if complain doesn't have tf_warning bit set. * g++.dg/warn/pr117825.C: New test. (cherry picked from commit e5180fbcbcc356c71154413588288cbd30e5198d)