https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126709
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
commit r17-2994-gc1377cb693d79838e8ea5ea9aaabff45b39c6fd0
Revert "OpenMP/OpenACC tests. vs C++26"
This reverts commit r16-5330-gedc821b60ce94b8ddb5d0b9ccdb9a0a4691371c7.
does
-#pragma omp target map(arr1[4,C: ])
+#pragma omp target map(arr1[4,C:])
// { dg-warning "top-level comma expression in array subscript is deprecated"
"" { target c++20_only } .-1 }
// { dg-error "cannot use multidimensional subscript in OpenMP array section"
"" { target c++23 } .-2 }
The problem here is that ':]' is consumed before skipping the following
']'/':]' via cp_parser_skip_to_closing_square_bracket.
Thus, we could either add another 'dg-error' line - or do the following, which
only affects this testcase. I am not sure what's better.
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -9466,2 +9466,2 @@ post_colon_parsing:
- if (!open_splice)
+ if (!open_splice && (!close_splice || index != error_mark_node))
cp_lexer_consume_token (parser->lexer);