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.
This commit is contained in:
Tobias Burnus
2025-12-12 22:44:15 +01:00
parent 7146cfc333
commit d02eebea7e
2 changed files with 4 additions and 2 deletions

View 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 () == '(')
{

View 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