Files
TheRock/compiler/amd-llvm/flang/test/Semantics/parent-comp-name.f90
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

71 lines
2.9 KiB
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Every other Fortran compiler (but one) interprets the names of parent
! components like this when the names of their types are the product of
! USE association with renaming.
module m1
type originalName
integer m
end type
end
module m2
use m1, newName => originalName
type, extends(newName) :: extended
integer n
end type
type, extends(newName) :: extended2
integer originalName ! ok
end type
contains
subroutine s1
type(extended) x
type(extended2) x2
print *, x%newName%m ! ok
!ERROR: Component 'originalname' not found in derived type 'extended'
print *, x%originalName
print *, extended(newName=newName(m=1),n=2) ! ok
!ERROR: Structure constructor lacks a value for component 'm'
!ERROR: Keyword 'originalname=' does not name a component of derived type 'extended'
!ERROR: Keyword 'm=' may not appear in a reference to a procedure with an implicit interface
print *, extended(originalName=originalName(m=1),n=2)
!ERROR: Value in structure constructor of type 'REAL(4)' is incompatible with component 'newname' of type 'newname'
!ERROR: Keyword 'm=' may not appear in a reference to a procedure with an implicit interface
print *, extended(newName=originalName(m=1),n=2)
!ERROR: Structure constructor lacks a value for component 'm'
!ERROR: Keyword 'originalname=' does not name a component of derived type 'extended'
print *, extended(originalName=newName(m=1),n=2)
print *, x2%newName%m ! ok
print *, x2%originalName ! ok
print *, extended2(newName=newName(m=1),originalName=2) ! ok
end
end
module m3
use m2
contains
! Same as above, but not in the same module as the derived
! types' definitions.
subroutine s2
type(extended) x
type(extended2) x2
print *, x%newName%m ! ok
!ERROR: Component 'originalname' not found in derived type 'extended'
print *, x%originalName
print *, extended(newName=newName(m=1),n=2) ! ok
!ERROR: Structure constructor lacks a value for component 'm'
!ERROR: Keyword 'originalname=' does not name a component of derived type 'extended'
!ERROR: Keyword 'm=' may not appear in a reference to a procedure with an implicit interface
print *, extended(originalName=originalName(m=1),n=2)
!ERROR: Value in structure constructor of type 'REAL(4)' is incompatible with component 'newname' of type 'newname'
!ERROR: Keyword 'm=' may not appear in a reference to a procedure with an implicit interface
print *, extended(newName=originalName(m=1),n=2)
!ERROR: Structure constructor lacks a value for component 'm'
!ERROR: Keyword 'originalname=' does not name a component of derived type 'extended'
print *, extended(originalName=newName(m=1),n=2)
print *, x2%newName%m ! ok
print *, x2%originalName ! ok
print *, extended2(newName=newName(m=1),originalName=2) ! ok
end
end