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: Fix PR 10471


This patch fixes a defect in my recent inlining/exceptions patch.

Tested on i686-pc-linux-gnu, applied on the mainline and on the
branch.

--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery dot com

2003-04-23  Mark Mitchell  <mark at codesourcery dot com>

	PR c++/10471
	* call.c (build_cxx_call): Robustify.

2003-04-23  Mark Mitchell  <mark at codesourcery dot com>

	PR c++/10471
	* g++.dg/template/defarg2.C: New test.

Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.377
diff -c -5 -p -r1.377 call.c
*** cp/call.c	22 Apr 2003 05:44:07 -0000	1.377
--- cp/call.c	24 Apr 2003 05:50:51 -0000
*************** build_cxx_call(tree fn, tree args, tree 
*** 4735,4745 ****
  
    fn = build_call (fn, converted_args);
  
    /* If this call might throw an exception, note that fact.  */
    fndecl = get_callee_fndecl (fn);
!   if ((!fndecl || !TREE_NOTHROW (fndecl)) && at_function_scope_p ())
      cp_function_chain->can_throw = 1;
  
    /* Some built-in function calls will be evaluated at compile-time in
       fold ().  */
    fn = fold (fn);
--- 4735,4747 ----
  
    fn = build_call (fn, converted_args);
  
    /* If this call might throw an exception, note that fact.  */
    fndecl = get_callee_fndecl (fn);
!   if ((!fndecl || !TREE_NOTHROW (fndecl)) 
!       && at_function_scope_p ()
!       && cfun)
      cp_function_chain->can_throw = 1;
  
    /* Some built-in function calls will be evaluated at compile-time in
       fold ().  */
    fn = fold (fn);
Index: testsuite/g++.dg/template/defarg2.C
===================================================================
RCS file: testsuite/g++.dg/template/defarg2.C
diff -N testsuite/g++.dg/template/defarg2.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/template/defarg2.C	24 Apr 2003 05:50:51 -0000
***************
*** 0 ****
--- 1,10 ----
+ struct X {
+     X ();
+ };
+ 
+ template <int> struct O {
+     struct I {
+         I (const X & = X());
+     };
+ };
+ template struct O<2>;


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