OpenCilk / opencilk-project

Monorepo for the OpenCilk compiler. Forked from llvm/llvm-project and based on Tapir/LLVM.
Other
93 stars 29 forks source link

Trouble binding a reference to a reducer view #123

Closed VoxSciurorum closed 1 year ago

VoxSciurorum commented 2 years ago

In the code below, the first *p should bind to the current view and the second *p should bind to the reducer.

extern void f(int &, int _Hyperobject &);
void g(int _Hyperobject *p)
{
f(*p, *p);
}
VoxSciurorum commented 1 year ago

Possibly related:

struct S { int operator&(); };

int f(struct S*sp) { return &*sp; }
int g(struct S _Hyperobject*sp) { return &*sp; } // error

The second function triggers an error:

operatora.cpp:4:42: error: cannot initialize return object of type 'int' with an rvalue of type 'struct S *'
int g(struct S _Hyperobject*sp) { return &*sp; }
                                         ^~
1 error generated.