The attached code causes an ICE with gcc 4.5 20091112. I'm somewhat certain but not positive that it is not valid code.
$ g++-4.5-20091112 -std=c++0x decl.cpp -o decl decl.cpp: In function 'std::unique_future<_Res> async(F) [with T = int, F = main()::<lambda()>]': decl.cpp:16:30: instantiated from here decl.cpp:7:46: internal compiler error: canonical types differ for identical types int() and int() Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. -- Summary: [C++0x] ICE on probably invalid with "canonical types differ for identical types" Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lloyd at randombit dot net GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42082