This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]