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

            Bug ID: 64324
           Summary: Deferred character specific functions not permitted in
                    generic operator interface
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ian_harvey at bigpond dot com

gfortran built from current trunk rejects the following with "Error: User
operator procedure ‘tostring’ at (1) cannot be assumed character length"

MODULE m
  IMPLICIT NONE
  INTERFACE OPERATOR(.ToString.)
    MODULE PROCEDURE tostring
  END INTERFACE OPERATOR(.ToString.)
CONTAINS
  FUNCTION tostring(arg)
    INTEGER, INTENT(IN) :: arg
    CHARACTER(:), ALLOCATABLE :: tostring
    tostring = '42'
  END FUNCTION tostring
END MODULE m


(The procedure has deferred length, not assumed length.)


$ gfortran -v -c 2014-12-16\ ToString.f90
Using built-in specs.
COLLECT_GCC=gfortran
Target: x86_64-unknown-linux-gnu
Configured with: .././src/configure --prefix=/home/MEGMS2/ian/usr/gcc-5.0.0
--enable-languages=c,c++,fortran --enable-libgomp --enable-checking=release
Thread model: posix
gcc version 5.0.0 20141215 (experimental) (GCC) 

COLLECT_GCC_OPTIONS='-v' '-c' '-mtune=generic' '-march=x86-64'
 /home/MEGMS2/ian/usr/gcc-5.0.0/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/f951
2014-12-16 ToString.f90 -quiet -dumpbase 2014-12-16 ToString.f90 -mtune=generic
-march=x86-64 -auxbase 2014-12-16 ToString -version -fintrinsic-modules-path
/home/MEGMS2/ian/usr/gcc-5.0.0/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/finclude
-o /tmp/cctex4Ju.s
GNU Fortran (GCC) version 5.0.0 20141215 (experimental)
(x86_64-unknown-linux-gnu)
    compiled by GNU C version 5.0.0 20141215 (experimental), GMP version 6.0.0,
MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran (GCC) version 5.0.0 20141215 (experimental)
(x86_64-unknown-linux-gnu)
    compiled by GNU C version 5.0.0 20141215 (experimental), GMP version 6.0.0,
MPFR version 3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
2014-12-16 ToString.f90:7:2:

   FUNCTION tostring(arg)
  1
Error: User operator procedure ‘tostring’ at (1) cannot be assumed character
length

Reply via email to