[Patch] Fortran: F2018 type(*),dimension(*) with scalars [PR104143]

Harald Anlauf anlauf@gmx.de
Tue Sep 20 19:59:22 GMT 2022


Am 20.09.22 um 13:51 schrieb Tobias Burnus:
> In several cases, one just wants to have the address where an object starts
> without requiring the detour via 'c_loc' and the (locally) required
> 'target'
> attribute.
>
> In principle,  type(*),dimension(*)  of TS29113 permits this, except that
> 'dimension(*)' only permits arrays and array elements but not scalars.
>
> Fortran 2018 modified this such that with 'type(*)' also scalars are
> permitted.
> (See PR for the quotes.)
>
> This patch implements this simple change. Before, implementations like MPI
> had to use '!GCC$ attribute NO_ARG_CHECK ::' in addition to
> type(*),dimension(*)
> to achieve this. In GCC, we do likewise, but that's at least inside the
> compiler,
> cf. libgomp/openacc{.f90,_lib.h}.
>
> OK for mainline?

LGTM.

Thanks for the patch!



More information about the Fortran mailing list