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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #1)
> I don't think the wording of g95 is explaining what is wrong.
> 
> Browsing F2018 I saw:
> 
> C15103 In the specification-expr that specifies a type parameter value of
> the result of an elemental function, an object designator with a dummy
> argument of the function as the base object shall appear only as the
> subject of a specification inquiry (10.1.11), ...
> 
> And 10.1.11 has:
> 
> A specification inquiry is a reference to
> 
> (1) an intrinsic inquiry function other than PRESENT,
> (2) a type parameter inquiry (9.4.5),
> (3) ...
> 
> TRIM and LEN_TRIM are not intrinsic inquiry functions.

Harald, your're analysis is correct for F2008 and F2018.

The g95 error message is correct for Fortran 95 and 2003.
>From F95, page 213, the relevant constraint is 

   Constraint: A dummy argument, or a subobject thereof, shall not
   appear in a specification-expr except as the argument to one of
   the intrinsic functions BIT_SIZE, KIND, LEN, or the numeric
   inquiry functions (13.11.8).

Note, this constraint applies to the entire specification expression.
F2018 C15103 is restricted to a "type parameter values" portion of a
specification expression.

Reply via email to