https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120021
Bug ID: 120021 Summary: Offloading vs. C++ 'std::valarray' Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: openacc, openmp Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org CC: burnus at gcc dot gnu.org, jakub at gcc dot gnu.org Target Milestone: --- A simple C++ 'std::valarray' code: #include <valarray> int main() { #pragma omp target #pragma acc serial { std::valarray<double> v1 = {1.0, 2.0, 3.0, 4.0, 5.0}; } return 0; } ... fails OpenACC, OpenMP offloading compilation : [...]/cxx-valarray-1.C:7:56: error: variable ‘C.0’ has been referenced in offloaded code but hasn’t been marked to be included in the offloaded code 7 | std::valarray<double> v1 = {1.0, 2.0, 3.0, 4.0, 5.0}; | ^ I've not yet determined if this needs something like PR85063 "Support switch conversion in offloading functions", or PR90779 "Fortran array initialization in offload regions", or something else.