llvm/flang/test/semantics/resolve30.f90
Tim Keith f69f7ecf48 [flang] Small improvements to name resolution
Resolve names and do implicit typing in ArrayElement and LoopBounds.

Fix problem with creation of UseErrorDetails: when a conflict occurs,
record both the original USE and the new one.

Resolve the type name in TypeAttrSpec::Extends. Move CheckUseError to
DeclarationVisitor so that it can be used in ResolveDerivedType.

Report error on unresolved names. I.e. after name resolution, check each
parser::Name and verify we have a Symbol for it. This is on by default
now but it could be an option.

Original-commit: flang-compiler/f18@1c8cbc6e53
Reviewed-on: https://github.com/flang-compiler/f18/pull/173
Tree-same-pre-rewrite: false
2018-08-29 11:38:12 -07:00

43 lines
1.2 KiB
Fortran

! Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
!
! Licensed under the Apache License, Version 2.0 (the "License");
! you may not use this file except in compliance with the License.
! You may obtain a copy of the License at
!
! http://www.apache.org/licenses/LICENSE-2.0
!
! Unless required by applicable law or agreed to in writing, software
! distributed under the License is distributed on an "AS IS" BASIS,
! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! See the License for the specific language governing permissions and
! limitations under the License.
subroutine s1
integer x
block
import, none
!ERROR: 'x' from host scoping unit is not accessible due to IMPORT
x = 1
end block
end
subroutine s2
block
import, none
!ERROR: 'y' from host scoping unit is not accessible due to IMPORT
y = 1
end block
end
subroutine s3
integer j
block
import, only: j
type t
!ERROR: 'i' from host scoping unit is not accessible due to IMPORT
real :: x(10) = [(i, &
!ERROR: 'i' from host scoping unit is not accessible due to IMPORT
i=1,10)]
end type
end block
end subroutine