]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Provide fixit hints for -Wdeprecated-openmp diagnostics from C++ FE
authorJakub Jelinek <jakub@redhat.com>
Sat, 13 Dec 2025 09:02:55 +0000 (10:02 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 13 Dec 2025 09:02:55 +0000 (10:02 +0100)
commitd5320610cd3614a83ea1f2c8122a6cfbad987eab
tree9543ef13f22147d4c081a32451b5c0f652619b8e
parent688d684f889f7e94d4c2de593afe77acdb069003
openmp: Provide fixit hints for -Wdeprecated-openmp diagnostics from C++ FE

I think especially the linear clause -Wdeprecated-openmp diagnostics
will be complete nightmare for users, when they have
linear (ref (x, y, z))
or
linear (uval (a, b, c) : 2)
they will have no clue what the new syntax is.

Here is an attempt to provide fixit hints from the C++ FE for most
of these warnings, and even -fdiagnostics-generate-patch can then be
useful for porting.

2025-12-13  Jakub Jelinek  <jakub@redhat.com>

* parser.cc (cp_parser_omp_clause_reduction): Provide fixit hints
for -Wdeprecated-openmp diagnostics.
(cp_parser_omp_clause_linear): Likewise.
(cp_parser_omp_clause_depend): Likewise.
(cp_parser_omp_clause_map): Likewise.  Reset num_commas after the
diagnostics.
(cp_parser_omp_clause_proc_bind): Provide fixit hints for
-Wdeprecated-openmp diagnostics.
(cp_parser_omp_all_clauses): Move -Wdeprecated-openmp diagnostics
for to vs. enter here, add fixit hints for it.
(cp_parser_omp_master):Add MASTER_LOC argument.  Provide fixit hints
for -Wdeprecated-openmp diagnostics.
(cp_parser_omp_parallel): Adjust cp_parser_omp_master caller.
(cp_parser_omp_declare_target): Don't emit -Wdeprecated-openmp
warning for to vs. enter here.
(cp_parser_omp_metadirective): Provide fixit hints for
-Wdeprecated-openmp diagnostics.
(cp_parser_omp_construct): Adjust cp_parser_omp_master caller.

* g++.dg/gomp/deprecate-1.C: New test.
gcc/cp/parser.cc
gcc/testsuite/g++.dg/gomp/deprecate-1.C [new file with mode: 0644]