* call.c (build_call_a): Also check at_function_scope_p.
authorJason Merrill <jason@redhat.com>
Tue, 2 Aug 2011 15:35:09 +0000 (11:35 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 2 Aug 2011 15:35:09 +0000 (11:35 -0400)
From-SVN: r177185

gcc/cp/ChangeLog
gcc/cp/call.c

index 4ce77d41553204c270bfb5877cb55d950a4f16b8..65d0e7c6628cabf692eb9c644d1d6f3c842018cb 100644 (file)
@@ -1,3 +1,7 @@
+2011-08-02  Jason Merrill  <jason@redhat.com>
+
+       * call.c (build_call_a): Also check at_function_scope_p.
+
 2011-08-01  Jason Merrill  <jason@redhat.com>
 
        PR c++/49932
index 2eab78266f8a539ed7237a8c9f4dcdd872bb2885..b0133e217099cfd0d53c937cb89f2f0a66554d27 100644 (file)
@@ -352,7 +352,7 @@ 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)
+  if (!nothrow && at_function_scope_p () && cfun && cp_function_chain)
     cp_function_chain->can_throw = 1;
 
   if (decl && TREE_THIS_VOLATILE (decl) && cfun && cp_function_chain)