commit 2d89beb80fa4656166d68c004d38b1087e8f12d5
Author: Jason Merrill <jason@redhat.com>
Date: Wed Jun 22 10:48:16 2011 -0400
PR c++/49260
* call.c (build_call_a): Set cp_function_chain->can_throw here.
(build_cxx_call): Not here.
@@ -352,6 +352,9 @@ build_call_a (tree function, int n, tree *argarray)
nothrow = ((decl && TREE_NOTHROW (decl))
|| TYPE_NOTHROW_P (TREE_TYPE (TREE_TYPE (function))));
+ if (!nothrow && cfun && cp_function_chain)
+ cp_function_chain->can_throw = 1;
+
if (decl && TREE_THIS_VOLATILE (decl) && cfun && cp_function_chain)
current_function_returns_abnormally = 1;
@@ -6710,11 +6713,6 @@ build_cxx_call (tree fn, int nargs, tree *argarray)
/* 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)
- cp_function_chain->can_throw = 1;
/* Check that arguments to builtin functions match the expectations. */
if (fndecl
@@ -1,5 +1,6 @@
// PR c++/47263
-// { dg-options -std=c++0x }
+// PR c++/49260
+// { dg-options "-std=c++0x -fno-asynchronous-unwind-tables -fno-dwarf2-cfi-asm" }
// { dg-do run }
#include <exception>