https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127559
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
My limited understanding on what this code aims to do is that it wants to map
*a somehow in (have been lazy to find out where exactly in the standard it says
it should do that):
void
foo (int *a)
{
auto b = [=] { return *a; };
#pragma omp target
{
if (b () != 42)
__builtin_abort ();
}
}
int
main ()
{
int a = 42;
foo (&a);
}
But does it handle even the case of
void
foo (int *a)
{
auto b = [=] { return *a; };
auto c = [=] { return b (); };
#pragma omp target
{
if (c () != 42)
__builtin_abort ();
}
}
int
main ()
{
int a = 42;
foo (&a);
}
? I don't see how (but am not sure it should). Similarly, what should happen
if anything with pointers/references inside of members of the closure object
(i.e. when some lambda references with [=] some structures with
pointers/references)?