This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68997] New: [cilkplus] cilk_spawn is broken for functions that return a type with a custom copy or move constructor
- From: "ryan.burn at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 21 Dec 2015 03:28:21 +0000
- Subject: [Bug c++/68997] New: [cilkplus] cilk_spawn is broken for functions that return a type with a custom copy or move constructor
- Auto-submitted: auto-generated
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;
}
////////////////////////////////////////////////////////