aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-06-22 11:55:22 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-06-22 11:55:22 -0400
commit8288cc7387c4490e0331f8288902159149f59889 (patch)
treeead6f7f0dca340d98c0451d50f9c394119bd42a5 /gcc
parent3b4c46d71190ead2f7fdde4d04103f4e838ced68 (diff)
downloadgcc-8288cc7387c4490e0331f8288902159149f59889.zip
gcc-8288cc7387c4490e0331f8288902159149f59889.tar.gz
gcc-8288cc7387c4490e0331f8288902159149f59889.tar.bz2
re PR c++/49260 ([C++0x] lambda-eh2.C fails execution)
PR c++/49260 * call.c (build_call_a): Set cp_function_chain->can_throw here. (build_cxx_call): Not here. From-SVN: r175296
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C3
4 files changed, 16 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a329733..505de35 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/49260
+ * call.c (build_call_a): Set cp_function_chain->can_throw here.
+ (build_cxx_call): Not here.
+
2011-06-21 Jason Merrill <jason@redhat.com>
PR c++/49172
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index dd4dced..cfaef7d8 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7579620..ee8866f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/49260
+ * g++.dg/cpp0x/lambda/lambda-eh2.C: Change options.
+
2011-06-22 Dmitry Plotnikov <dplotnikov@ispras.ru>
Dmitry Melnik <dm@ispras.ru>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C
index 1490a25..0c94b55 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C
@@ -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>