I ran your example on OS X Lion using:
clang++ -std=c++0x -stdlib=libc++ async.cpp
And the output of the program:
doing stuff The answer to life, the universe and everything is 42
Checking the source of libC ++, as suggested by moshbear comment, I see:
exception_ptr::~exception_ptr() _NOEXCEPT { #if HAVE_DEPENDENT_EH_ABI __cxa_decrement_exception_refcount(__ptr_); #else #warning exception_ptr not yet implemented ::abort(); #endif
It seems to me that ~exception_ptr() not been ported to ubuntu 10.04. This is a low-level tool not implemented in portable C ++. Work on creating a GPL-free implementation of this level continues in lib ++ abi . I can assure you that libC ++ abi is currently not ready for prime time.
This low-level library also had independent efforts: https://github.com/pathscale/libcxxrt . I do not know the status of this library and have not been ported to ubuntu.
source share