]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
OpenMP/Fortran: uses_allocators - suggest 5.2 format in the warning
authorTobias Burnus <tburnus@baylibre.com>
Fri, 12 Dec 2025 21:44:15 +0000 (22:44 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Fri, 12 Dec 2025 21:44:15 +0000 (22:44 +0100)
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.

gcc/fortran/openmp.cc
libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90

index 68533a77882bd24dc5a57ed383a189a4f9ba1ec2..af89c87b0ab0732e8019196c510a881375ce4528 100644 (file)
@@ -1864,7 +1864,9 @@ gfc_match_omp_clause_uses_allocators (gfc_omp_clauses *c)
                         "The specification of arguments to "
                         "%<uses_allocators%> at %L where each item is of "
                         "the form %<allocator(traits)%> is deprecated since "
-                        "OpenMP 5.2", &p->where);
+                        "OpenMP 5.2; instead use %<uses_allocators(traits(%s"
+                        "): %s)%>", &p->where, p->u2.traits_sym->name,
+                        p->sym->name);
        }
       else if (gfc_peek_ascii_char () == '(')
        {
index c48bca2ffa976a07aaf2141ba0961ae6c141f051..6194dad2cfcdeb3c8af8c63129263c28e459f05a 100644 (file)
@@ -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