]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP: Fix C++ template handling with append_args' prefer_type modifier
authorTobias Burnus <tburnus@baylibre.com>
Thu, 27 Mar 2025 13:09:20 +0000 (14:09 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 27 Mar 2025 13:09:20 +0000 (14:09 +0100)
commit7e286b56545e1bd28098cc197e674d02f3849ec3
tree85bb8fa040090b51d7fb832ff93d5323ee1684d4
parent6acfb68dc0a4798ca0a6ddae894c70f815f5295d
OpenMP: Fix C++ template handling with append_args' prefer_type modifier

It is possible but not very sensible to use C++ templates with in the
prefer_type modifier to the 'append_args' clause of 'declare variant'.

The commit r15-6336-g12dd892b1a3ad7 added substitution support in pt.cc,
but missed to update afterward the actual data in decl.cc.
As gimplification support was only added in r15-8898-gf016ee89955ab4,
this could not be tested back then. The latter commit added a sorry
for it gimplify.cc and the existing testcase, which this commit now removes.

gcc/cp/ChangeLog:

* cp-tree.h (cp_finish_omp_init_prefer_type): Add.
* decl.cc (omp_declare_variant_finalize_one): Call it.
* pt.cc (tsubst_attribute): Minor rebustification for OpenMP
append_args handling.
* semantics.cc (cp_omp_init_prefer_type_update): Rename to ...
(cp_finish_omp_init_prefer_type): ... this; remove static attribute
and return modified tree. Move clause handling to ...
(finish_omp_clauses): ... the caller.

gcc/ChangeLog:

* gimplify.cc (modify_call_for_omp_dispatch): Remove sorry.

gcc/testsuite/ChangeLog:

* g++.dg/gomp/append-args-1.C: Remove expected dg-sorry.
* g++.dg/gomp/append-args-8.C: New test.
gcc/cp/cp-tree.h
gcc/cp/decl.cc
gcc/cp/pt.cc
gcc/cp/semantics.cc
gcc/gimplify.cc
gcc/testsuite/g++.dg/gomp/append-args-1.C
gcc/testsuite/g++.dg/gomp/append-args-8.C [new file with mode: 0644]