[committed] Revert "OpenMP/OpenACC tests. vs C++26"

Tobias Burnus <[email protected]> Wed, 5 Aug 2026 23:06:32 +0200
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
Since -std=c++26, 'map( arr[:N] )' failed to parse - as the
OpenMP array section 'var[lower:upper]' was no longer lexed as
   'arr' <open-square> <colon> 'N' <close-square>
but as
   'arr' <open-splice> 'N' <close-square>
which failed.

To continue to permit compilation with C++ (that cycles through
multiple -std=c++... versions), commit r16-5330-gedc821b60ce94b
added a space before the colon such that the same tokens were
produced as with -std=c++23.

Since commit r17-2993-g8f43cf55107e34
"C++: Handle OpenMP/OpenACC array sections [: / :] with C++26"
this is no longer needed - and, hence, the commit could be
reverted - ensuring a better test coverage (the colon code is
tested for with -std=c++23, the splice code with -std=c++26)
and the code looks more normal.

A diff with '-U0 -w' (no whitespace changes) is just a removed
'dg-skip-if' for 'c++26', namely, the following:
[There were more, but those were already removed by commit r17-2993].

Namely for both
gcc/testsuite/c-c++-common/goacc/cache-3-1.c and
gcc/testsuite/g++.dg/goacc/data-clause-2.C

@@ -9,4 +8,0 @@
-/* Array sections without spaces between [ and : or : and ] are incompatible
-   with C++26.  */
-/* { dg-skip-if "array sections vs. C++26" { c++26 } } */

Committed as r17-2994-gc1377cb693d798

Tobias
committed.diff (text/x-patch, 249.4 KB) - not displayed