[Bug c++/95474] class member array cannot be mapped
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95474 --- Comment #5 from Jakub Jelinek --- Hopefully this year. What you can do in the meantime is auto *mydata = data; and use mydata instead of data.
[Bug c++/95474] class member array cannot be mapped
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95474 --- Comment #4 from Ye Luo --- Thanks. Hopefully this part of 5.0 feature will be implemented in the near future.
[Bug c++/95474] class member array cannot be mapped
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95474 --- Comment #3 from Jakub Jelinek --- 4.0 had a clear "A variable that is part of another variable (such as a field of a structure) but is not an array element or an array section cannot appear in a map clause." restriction, this has been lifted in 4.5 to allow the var.xyz style mapping, but it still didn't allow general expressions as the bases of array sections. Only 5.0 allows arbitrary expressions there.
[Bug c++/95474] class member array cannot be mapped
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95474 --- Comment #2 from Ye Luo --- @jakub could you mention which page and line in 4.5 spec this code violates? https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5.0.pdf
[Bug c++/95474] class member array cannot be mapped
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95474 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- It is not broken, IMHO what you are trying to do is not valid in OpenMP 4.5. It is valid in OpenMP 5.0, but GCC doesn't implement that part yet.