OpenMP: Fix g++.dg/gomp/bad-array-section-10.C for C++23 and up

Message ID 20240110131448.989596-1-julian@codesourcery.com
State Unresolved
Headers
Series OpenMP: Fix g++.dg/gomp/bad-array-section-10.C for C++23 and up |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Julian Brown Jan. 10, 2024, 1:14 p.m. UTC
  This patch adjusts diagnostic output for C++23 and above for the test
case mentioned in the commit title.

I will apply shortly as obvious.

2024-01-10  Julian Brown  <julian@codesourcery.com>

gcc/testsuite/
	* g++.dg/gomp/bad-array-section-10.C: Adjust diagnostics for C++23 and
	up.
---
 gcc/testsuite/g++.dg/gomp/bad-array-section-10.C | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C b/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C
index 393b0fefe51..286e72e9f64 100644
--- a/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C
+++ b/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C
@@ -6,12 +6,15 @@  void foo()
   int arr1[40];
 #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 }
   { }
 #pragma omp target map(arr1[4,5:C,7])
 // { 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 }
   { }
 #pragma omp target map(arr1[:8,C,10])
 // { 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 }
   { }
 }
 
@@ -20,12 +23,15 @@  int main()
   int arr1[40];
 #pragma omp target map(arr1[4,5:])
 // { 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 }
   { }
 #pragma omp target map(arr1[4,5:6,7])
 // { 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 }
   { }
 #pragma omp target map(arr1[:8,9,10])
 // { 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 }
   { }
 
   foo<6, 9> ();