OpenMP: Fix g++.dg/gomp/bad-array-section-10.C for C++23 and up
Checks
Commit Message
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(+)
@@ -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> ();