OSDN Git Service

PR c++/47263
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 May 2011 01:08:31 +0000 (01:08 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 May 2011 01:08:31 +0000 (01:08 +0000)
* decl.c (use_eh_spec_block): Do use an EH spec block for a
lambda op().

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174161 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C [new file with mode: 0644]

index 230b588..422d76b 100644 (file)
@@ -1,5 +1,9 @@
 2011-05-24  Jason Merrill  <jason@redhat.com>
 
+       PR c++/47263
+       * decl.c (use_eh_spec_block): Do use an EH spec block for a
+       lambda op().
+
        PR c++/47336
        * error.c (dump_template_bindings): Suppress access control.
 
index 108bb47..9e029d2 100644 (file)
@@ -12570,7 +12570,7 @@ use_eh_spec_block (tree fn)
             not creating the EH_SPEC_BLOCK we save a little memory,
             and we avoid spurious warnings about unreachable
             code.  */
-         && !DECL_ARTIFICIAL (fn));
+         && !DECL_DEFAULTED_FN (fn));
 }
 
 /* Store the parameter declarations into the current function declaration.
index 9185ae5..a5f3ea7 100644 (file)
@@ -1,5 +1,7 @@
 2011-05-24  Jason Merrill  <jason@redhat.com>
 
+       * g++.dg/cpp0x/lambda/lambda-eh2.C: New.
+
        * g++.dg/cpp0x/error3.C: New.
 
        * g++.dg/cpp0x/defaulted27.C: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh2.C
new file mode 100644 (file)
index 0000000..1490a25
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/47263
+// { dg-options -std=c++0x }
+// { dg-do run }
+
+#include <exception>
+
+int main( void )
+{
+  std::set_unexpected( []{ throw 0; } );
+  try
+    {
+      []() throw( int ) { throw nullptr; }();
+    }
+  catch( int )
+    { }
+}