https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94742
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-9 branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:e9dbd80b5e62a126ccb40970f0fb233f7e0ac3a6 commit r9-8885-ge9dbd80b5e62a126ccb40970f0fb233f7e0ac3a6 Author: Jakub Jelinek <ja...@redhat.com> Date: Sat Apr 25 00:11:35 2020 +0200 c++: Avoid -Wreturn-type warning if a template fn calls noreturn template fn [PR94742] finish_call_expr already has code to set current_function_returns_abnormally if a template calls a noreturn function, but on the following testcase it doesn't call a FUNCTION_DECL, but TEMPLATE_DECL instead, in which case we didn't check noreturn at all and just assumed it could return. 2020-04-25 Jakub Jelinek <ja...@redhat.com> PR c++/94742 * semantics.c (finish_call_expr): When looking if all overloads are noreturn, use STRIP_TEMPLATE to look through TEMPLATE_DECLs. * g++.dg/warn/Wreturn-type-12.C: New test. (cherry picked from commit 4ff685a8705e8ee55fa86e75afb769ffb0975aea)