af2940cfb6
In Symbol and Scope, use SourceName (== parser::CharBlock) in place of Name (== std::string) so that names in the symtab have provenance. We may ultimately have multiple source locations associated with a symbol. ImplicitRules: Add isImplicitNoneType and isImplicitNoneExternal flags. MessageHandler: Add methods to emit messages associated with source locations. Detect conflicting declarations of symbols (e.g. as subprogram and variable). Handle attribute statements like ASYNCHRONOUS statement: make sure the symbol is present and set the attribute on it. Check that these all have a type declared by the end of the specification part if IMPLICIT NONE. Find variables named in Variable and Expr nodes and check they have types declared if IMPLICIT NONE. Otherwise, make sure they are in the symtab and apply the implicit type rules at the end of the scope. Push a scope for MainProgram nodes and add a symbol for the name if it has one. Rename Scope::map_type to Scope::mapType Add tests for errors currently being detected. There is no framework for running them yet, just source files with the expected errors in comments. Original-commit: flang-compiler/f18@39e6fa4169 Reviewed-on: https://github.com/flang-compiler/f18/pull/49 Tree-same-pre-rewrite: false
11 lines
309 B
Fortran
11 lines
309 B
Fortran
subroutine s1
|
|
implicit none
|
|
!ERROR: IMPLICIT statement after IMPLICIT NONE or IMPLICIT NONE(TYPE) statement
|
|
implicit integer(a-z)
|
|
end subroutine
|
|
|
|
subroutine s2
|
|
implicit none(type)
|
|
!ERROR: IMPLICIT statement after IMPLICIT NONE or IMPLICIT NONE(TYPE) statement
|
|
implicit integer(a-z)
|
|
end subroutine
|