This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/68997] New: [cilkplus] cilk_spawn is broken for functions that return a type with a custom copy or move constructor


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;                                                                     
} 
////////////////////////////////////////////////////////

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]