https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119288
Bug ID: 119288 Summary: [OpenMP] declare variant - adjust_args only detects invalid use when invoked Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: accepts-invalid, diagnostic, openmp Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- Assume the following, created for PR115271. * As written, the program compiles without any diagnostic even though adjust_args(need_device_ptr: 1, 3) adjust_args(nothing: 1) specified argument 1 twice * When the '!' lines are commented in, i.e. the function is used, a diagnostic is printed but it is not very helpful: 15 | use m_test1 | 1 Error: ‘x’ at (1) is specified more than once For the latter, it seems as if we want to modify the wording or add an inform (only when use associated?) to point out what this is all about. ---------------------- module m1 implicit none (type, external) contains integer function m1_f (x, y, z) use iso_c_binding type(c_ptr) :: x, y, z value :: x m1_f = 1 end integer function m1_g (x, y, z) use iso_c_binding type(c_ptr) :: x, y, z value :: x m1_g = 2 end end module m1 ---------------------- ---------------------- module m_test1 use m1, only: my_m1_f => m1_f, my_m1_g => m1_g !$omp declare variant(my_m1_g : my_m1_f) match(construct={dispatch}) adjust_args(need_device_ptr: 1, 3) adjust_args(nothing: 1) end subroutine test1 use m_test1 use iso_c_binding, only: c_ptr implicit none (type, external) type(c_ptr) :: a1,b1,c1 integer :: i ! !$omp dispatch ! i = my_m1_g(a1,b1,c1) end ----------------------