Skip to content

[Flang] Compilation error when rename-list is used in use statement #106020

@ohno-fj

Description

@ohno-fj
Version of flang-new : 20.0.0(3496245ed3d0b4d24444260da77dcdb93512fb5a/AArch64

When 'rename-list' is used in 'use' statement, a compilation error occurs.

The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.

snfm_peta_xref_001_2.f90:

program main
  print *,"pass"
end program main

module mod
  logical,protected,external :: int4
  pointer :: int4
contains
  subroutine sss()
  contains
  end subroutine sss
end module mod

subroutine subb()
  use mod,sss=>int4
end subroutine subb
$ flang-new snfm_peta_xref_001_2.f90
error: Semantic errors in snfm_peta_xref_001_2.f90
./snfm_peta_xref_001_2.f90:15:11: error: A PROTECTED entity must be in the specification part of a module
    use mod,sss=>int4
            ^^^
./snfm_peta_xref_001_2.f90:15:11: error: A PROTECTED entity must be a variable or pointer
    use mod,sss=>int4
            ^^^
$
$ gfortran snfm_peta_xref_001_2.f90; ./a.out
 pass
$
$ ifort -diag-disable=10448 snfm_peta_xref_001_2.f90; ./a.out
 pass
$

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorflang:frontend

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions