This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++] PATCH to build_throw for 11725
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 18 Jan 2004 10:40:23 -0500
- Subject: [C++] PATCH to build_throw for 11725
As Andrew suggested in the PR. Tested x86_64-linux-gnu, applied to trunk
and 3.4. Testcase in g++.dg/warn/Wreturn-type-1.C.
2004-01-16 Jason Merrill <jason@redhat.com>
PR c++/11725
* except.c (build_throw): In a template, set
current_function_returns_abnormally.
*** except.c.~1~ 2004-01-16 16:48:07.000000000 -0500
--- except.c 2004-01-16 16:41:08.000000000 -0500
*************** build_throw (tree exp)
*** 621,627 ****
return exp;
if (processing_template_decl)
! return build_min (THROW_EXPR, void_type_node, exp);
if (exp == null_node)
warning ("throwing NULL, which has integral, not pointer type");
--- 621,630 ----
return exp;
if (processing_template_decl)
! {
! current_function_returns_abnormally = 1;
! return build_min (THROW_EXPR, void_type_node, exp);
! }
if (exp == null_node)
warning ("throwing NULL, which has integral, not pointer type");