------- Comment #2 from erik dot edelmann at iki dot fi  2005-10-24 12:53 
-------
(In reply to comment #1)
> Here is what I get with the mainline of GCC:
>  In file t.f90:12
> 
> PUBLIC :: s_to_c
>                1
> Error: 'string' is a PRIVATE type and cannot be a dummy argument of 's_to_c',
> which is PUBLIC at (1)

Gfortran is correct; the code is invalid.  However, if we make it valid by
declaring the type VARYING_STRING public too, we get the error message
of the OP.  Here's a reduced testcase

kl-nrb:~$ cat hum.f90
MODULE ISO_VARYING_STRING

CONTAINS

 FUNCTION s_to_c(chars)
  CHARACTER,DIMENSION(:),POINTER :: chars
  CHARACTER(LEN=SIZE(chars)) :: s_to_c
  s_to_c = ''
 ENDFUNCTION s_to_c

END MODULE ISO_VARYING_STRING
kl-nrb:~$ gfortran hum.f90
hum.f90: In function 's_to_c':
hum.f90:5: internal compiler error: in gfc_finish_var_decl, at
fortran/trans-decl.c:444
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

I think I've seen this bug reported somewhere, but couldn't find it in a quick
search.


-- 

erik dot edelmann at iki dot fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |erik dot edelmann at iki dot
                   |                            |fi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24503

Reply via email to