Hi,
I think your patch / r17-6101-g440449a6671901 commit caused the
following FAILs in the a file that you added in
commit r17-6099-g9bafebd00ec544:
FAIL: g++.dg/gomp/allocate-handles-2.C -std=c++11 (test for excess errors)
FAIL: g++.dg/gomp/allocate-handles-2.C -std=c++20 (test for excess errors)
FAIL: g++.dg/gomp/allocate-handles-2.C -std=c++29 (test for excess errors)
Namely, the excess errors:
cc1plus: error: 'allocator' clause must not be 'omp_cgroup_mem_alloc',
'omp_pteam_mem_alloc', or 'omp_thread_mem_alloc'
cc1plus: error: 'allocator' clause must not be 'omp_cgroup_mem_alloc',
'omp_pteam_mem_alloc', or 'omp_thread_mem_alloc'
cc1plus: error: 'allocator' clause must not be 'omp_cgroup_mem_alloc',
'omp_pteam_mem_alloc', or 'omp_thread_mem_alloc'
What puzzles me here in addition: Why is there no location data for
those?
The code uses:
+ error_at (EXPR_LOCATION (alloc_in),
I wonder whether that should be:
EXPR_LOC_OR_LOC (alloc_in, loc)
instead.
Can you have a look?
Thanks for having a look - and thanks for your patches!
Tobias
* * *
Waffl3x wrote:
Trivial fix to reject omp_cgroup_mem_alloc, omp_pteam_mem_alloc, and
omp_thread_mem_alloc for variables of static lifetime.
Also adjusts the related testcase as it incorrectly uses static on global
variables, which instead means internal linkage in this context.
PR c/122892
gcc/cp/ChangeLog:
* semantics.cc (finish_omp_allocate): Reject
omp_{cgroup,pteam,thread}_mem_alloc for static vars.
gcc/testsuite/ChangeLog:
* c-c++-common/gomp/allocate-20.c: Remove sorry, add tests, remove
static from globals.