http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52988
Bug #: 52988 Summary: std::async not executed on function returning nullptr_t Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: surfinthe...@yahoo.com Created attachment 27157 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27157 Sample code demonstrating bug and workaround. Given a function which returns a nullptr_t, the following appears to not call the function: future<nullptr_t> fnp = async(returns_nullptr_t); fnp.get(); For a function which returns an int, the behavior is as expected. A workaround is to call fnp.wait() before fnp.get(). In that case, the function is indeed called (and its side-effects are observed). The attached file demonstrates the bug clearly. When executed, one should see the output: returns_nullptr_t returns_int but only the second line shows. If the workaround is applied, then both lines show.