This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47263] New: [C++0x] lambda + dynamic-exception-specification std::unexpected() is not called.
- From: "flast at flast dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Jan 2011 03:20:29 +0000
- Subject: [Bug c++/47263] New: [C++0x] lambda + dynamic-exception-specification std::unexpected() is not called.
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47263
Summary: [C++0x] lambda + dynamic-exception-specification
std::unexpected() is not called.
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: flast@flast.jp
In GCC4.5/4.6, if lambda throws unexpected exception, std::unexpected() is not
called but std::terminate() is called immidiately.
test code:
#include <exception>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main( void )
{
set_unexpected( []{ puts( "unexpected" ); fflush( stdout ); throw 0; } );
set_terminate( []{ puts( "terminate" ); fflush( stdout ); abort(); } );
try
{
[]() throw( int ) { throw exception(); }();
}
catch( int )
{
puts( "catch" );
}
}
output:
$ ./a.out
terminate
zsh: abort ./a.out