From: Tobias Burnus Date: Fri, 12 Dec 2025 21:44:15 +0000 (+0100) Subject: OpenMP/Fortran: uses_allocators - suggest 5.2 format in the warning X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d02eebea7ea937026c4de4453b3753088da38dd8;p=thirdparty%2Fgcc.git OpenMP/Fortran: uses_allocators - suggest 5.2 format in the warning Actually mention how the new 5.2+ syntax looks like when outputting the deprecation warning for 'uses_allocators'. gcc/fortran/ChangeLog: * openmp.cc (gfc_match_omp_clause_uses_allocators): Mention new syntax in deprecation warning. libgomp/ChangeLog: * testsuite/libgomp.fortran/dep-uses-allocators.f90: Update dg-warning. --- diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 68533a77882..af89c87b0ab 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -1864,7 +1864,9 @@ gfc_match_omp_clause_uses_allocators (gfc_omp_clauses *c) "The specification of arguments to " "% at %L where each item is of " "the form % is deprecated since " - "OpenMP 5.2", &p->where); + "OpenMP 5.2; instead use %", &p->where, p->u2.traits_sym->name, + p->sym->name); } else if (gfc_peek_ascii_char () == '(') { diff --git a/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90 b/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90 index c48bca2ffa9..6194dad2cfc 100644 --- a/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90 +++ b/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90 @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-warning "The specification of arguments to 'uses_allocators' at \\(1\\) where each item is of the form 'allocator\\(traits\\)' is deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 11 } +! { dg-warning "The specification of arguments to 'uses_allocators' at \\(1\\) where each item is of the form 'allocator\\(traits\\)' is deprecated since OpenMP 5.2; instead use 'uses_allocators(traits(trait): a1)' \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 11 } program test use omp_lib