aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/contracts.cc
diff options
context:
space:
mode:
authorSandra Loosemore <sloosemore@baylibre.com>2024-09-06 20:58:13 +0000
committerSandra Loosemore <sloosemore@baylibre.com>2024-09-24 15:04:08 +0000
commit96246bff0bcd9e5cdec9e6cf811ee3db4997f6d4 (patch)
treed41609ae565965c5a885121ac658efd8fb0fca49 /gcc/cp/contracts.cc
parent2114243c23ec5168cd54633cd4995ab123d92573 (diff)
downloadgcc-96246bff0bcd9e5cdec9e6cf811ee3db4997f6d4.zip
gcc-96246bff0bcd9e5cdec9e6cf811ee3db4997f6d4.tar.gz
gcc-96246bff0bcd9e5cdec9e6cf811ee3db4997f6d4.tar.bz2
OpenMP: Check additional restrictions on context selector properties
TR13 (pre-6.0) of the OpenMP spec says: "Each trait-property may only be specified once in a trait selector other than those in the construct selector set." and "If trait-property any is specified in the kind trait-selector of the device selector set or the target_device selector sets, no other trait-property may be specified in the same selector set." These restrictions (with slightly different wording) date back to OpenMP 5.1, but were not in 5.0 which was the basis for GCC's implementation. This patch adds a diagnostic, adds new testcases, and fixes some older testcases that include now-invalid selectors. gcc/ChangeLog * omp-general.cc (omp_check_context_selector): Reject other properties in the same selector set with kind(any). Also reject duplicate name-list properties. gcc/testsuite/ChangeLog * c-c++-common/gomp/declare-variant-10.c: Fix broken tests. * c-c++-common/gomp/declare-variant-3.c: Likewise. * c-c++-common/gomp/declare-variant-9.c: Likewise. * c-c++-common/gomp/declare-variant-any.c: New. * c-c++-common/gomp/declare-variant-duplicates.c: New. * gfortran.dg/gomp/declare-variant-10.f90: Fix broken tests. * gfortran.dg/gomp/declare-variant-3.f90: Likewise. * gfortran.dg/gomp/declare-variant-9.f90: Likewise. * gfortran.dg/gomp/declare-variant-any.f90: New. * gfortran.dg/gomp/declare-variant-duplicates.f90: New.
Diffstat (limited to 'gcc/cp/contracts.cc')
0 files changed, 0 insertions, 0 deletions