https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68997
Bug ID: 68997 Summary: [cilkplus] cilk_spawn is broken for functions that return a type with a custom copy or move constructor Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ryan.burn at gmail dot com Target Milestone: --- The below code should be valid but gives this error: main.cpp: In function ‘void compute_cilk()’: main.cpp:15:26: error: invalid use of ‘_Cilk_spawn’ auto v1 = cilk_spawn f(); ^ //////////////////////////////////////////////////////// #include <cilk/cilk.h> #include <cilk/cilk_api.h> struct A { A() = default; A(const A&) {} // uncomment and it works // A(A &&) {} // broken for move constructors also }; A f() { return A{}; } void compute_cilk() { auto v1 = cilk_spawn f(); auto v2 = f(); cilk_sync; } int main() { compute_cilk(); return 0; } ////////////////////////////////////////////////////////