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: [email protected]
ReportedBy: [email protected]
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