(this is a spinoff of PR29267)

[EMAIL PROTECTED]:~/src/pr/29267> cat t.f90
 implicit character*32 (a-z)
  CHARACTER(len=255), DIMENSION(1,2)  :: a
  a = reshape((/ to_string(1.0) /), (/ 1, 2 /))
  print *, a
  CONTAINS
    CHARACTER(32) FUNCTION to_string(x)
      REAL, INTENT(in) :: x
      WRITE(to_string, FMT="(F6.3)") x
    END FUNCTION
END PROGRAM
[EMAIL PROTECTED]:~/src/pr/29267> gfortran t.f90
 In file t.f90:6

    CHARACTER(32) FUNCTION to_string(x)
                                   1
 In file t.f90:3

  a = reshape((/ to_string(1.0) /), (/ 1, 2 /))
                         2
Error: Procedure 'to_string' at (1) has an explicit interface and must not have
attributes declared at (2)
 In file t.f90:6

    CHARACTER(32) FUNCTION to_string(x)
                         1
Error: Syntax error in data declaration at (1)
 In file t.f90:7

      REAL, INTENT(in) :: x
                          1
Error: Unexpected data declaration statement in CONTAINS section at (1)
 In file t.f90:8

      WRITE(to_string, FMT="(F6.3)") x
                    1
Error: Syntax error in WRITE statement at (1)
 In file t.f90:9

    END FUNCTION
      1
Error: Expecting END PROGRAM statement at (1)
[EMAIL PROTECTED]:~/src/pr/29267>


-- 
           Summary: implicit type declaration and contained function clash
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobi at gcc dot gnu dot org


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

Reply via email to