https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107028
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> --- Minor postscript: While the following (reduced testcase in comment 0) looks a bit odd, int data; ... #pragma acc data copyin(a, a.data) the original uses a pointer. Thus, something like int *data; ... #pragma acc data copyin(a, a.data[0:n]) which is more sensible. This variant still gives an ICE. However, either variant shouldn't ICE BTW: GCC 12 has the following omplower dump for this variant: #pragma omp target oacc_data \ map(to:a [len: 8]) map(alloc:a.data [len: 8]) \ map(to:*_8 [len: _7]) map(attach:a.data [bias: 0]) -------------------------------------- long long n = 10; class data_container { public: int *data; }; void test2() { data_container a; a.data = (int*)__builtin_malloc (n * sizeof (int)); #pragma acc data copyin(a, a.data[0:n]) { } }