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

--- Comment #6 from nathanael.huebbe at informatik dot uni-hamburg.de ---
(In reply to kargl from comment #5)
> With the patch I posted earlier today and code in comment #1, I see
> 
>  gfc7 -c a.f90
> a.f90:14:30:
> 
>          print*, len(me%string)
>                               1
> Error: Data transfer element at (1) cannot be polymorphic unless it
> is processed by a defined input/output procedure
> 
> I don't use CLASS and know little about its expected behavior.
> Is the above even remotely right?

I don't think so, but I may be wrong since I'm not an expert when it comes to
the FORTRAN standard. The error sounds weird to me, because I would not
consider `me%string` to be polymorphic to begin with, and because the value
that is printed is the result of the `len()` intrinsic, which is just a
non-polymorphic `integer`. Even the type of `me` is known precisely at this
point since the statement appears within a `type is()` clause.

What I would naively expect is that the code
  * compiles without error or warning (the issue in comment #1), and that it 
  * prints the correct length of the string (the issue in comment #3).

(I do hope my expectations are not in conflict with the standard...)

Reply via email to