https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113338

--- Comment #4 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #1)
> NAG also rejects the code.
> 
> The code compiles with gfortran if one declares t interoperable:
> 
>   type, bind(c) :: t
> 
> 
> Note that F2008 still had:
> 
> "(5) any dummy argument without the VALUE attribute corresponds to a formal
>  parameter of the prototype that is of a pointer type, and the dummy argument
>  is interoperable with an entity of the referenced type (ISO/IEC 9899:1999,
>  6.2.5, 7.17, and 7.18.1) of the formal parameter, ..."
> 
> I wonder why the interoperability requirement was dropped.

For completeness, here's the F2018 version of that item:

F2018:18.3.6  Interoperability of procedures and procedure interfaces

"(5) any dummy argument without the VALUE attribute corresponds to a
formal parameter of the prototype that is of a pointer type, and either
 • the dummy argument is interoperable with an entity of the referenced
   type (ISO/IEC 9899:2011, 6.2.5, 7.19, and 7.20.1) of the formal
   parameter,
 • the dummy argument is a nonallocatable nonpointer variable of type
   CHARACTER with assumed character length and the formal parameter is a
   pointer to CFI_cdesc_t,
 • the dummy argument is allocatable, assumed-shape, assumed-rank, or a
   pointer without the CONTIGUOUS attribute, and the formal parameter is a
   pointer to CFI_cdesc_t, or
 • the dummy argument is assumed-type and not allocatable, assumed-shape,
   assumed-rank, or a pointer, and the formal parameter is a pointer to void,"

Reply via email to