Skip to content

[flang] Compilation error of explicit declaration of dummy argument #60224

@ohno-fj

Description

@ohno-fj
Version of flang-new : 16.0.0(77f2f34d696b77fe5bf05afbe7386966b6bcc8ba)

flang-new points out that there is no explicit type declaration of dummy argument.

The following are the test program, flang-new, gfortran and ifort compilation result.

snggm004_2.f90:

PROGRAM main
  IMPLICIT NONE
  EXTERNAL    sub1
  INTEGER  :: i1 = 1
  integer  :: j
  CALL sub (sub1, i1)
  print *,'OK'
END PROGRAM main

SUBROUTINE sub (routine, i)
  IMPLICIT NONE
  INTEGER, INTENT(IN   ) :: i
  CALL routine (i)
END SUBROUTINE sub

SUBROUTINE sub1 (ii)
  IMPLICIT NONE
  INTEGER, INTENT(IN   ) :: ii
  WRITE (6,*)  ii
END SUBROUTINE sub1
$ flang-new -flang-experimental-exec snggm004_2.f90
error: Semantic errors in snggm004_2.f90
./snggm004_2.f90:10:17: error: No explicit type declared for 'routine'
  SUBROUTINE sub (routine, i)
                  ^^^^^^^
$
$ gfortran snggm004_2.f90
$
$ ifort snggm004_2.f90
$

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions