[flang] Semantic check for C708
authorPete Steinfeld <psteinfeld@nvidia.com>
Tue, 11 Feb 2020 20:14:04 +0000 (12:14 -0800)
committerPete Steinfeld <psteinfeld@nvidia.com>
Fri, 14 Feb 2020 16:33:07 +0000 (08:33 -0800)
commit79f38ab4bb612f5bcebd35c3318e1fcf9516babb
treefedb980dc917ae8c2cb13dd37d389d0eeede5249
parentd7cee59762f50477a5616cff8cf4f3a3b17e1573
[flang] Semantic check for C708

An entity declared with the CLASS keyword shall be a dummy argument or
have the ALLOCATABLE or POINTER attribute.

Implementing this check revealed a problem in the test resolve44.cpp.
It also showed that we were doing semantic checking on the entities
created by the compiler for LOCAL and LOCAL_INIT locality-specs.  So I
changed the creation of symbols associated with LOCAL and LOCAL_INIT
locality-specs to be host associated with the outer symbol rather than
new object entities.  In the process, I also changed things so that the
`parser::Name` associated with the newly created symbols was set to the
symbol rather than being set to nullptr.

Original-commit: flang-compiler/f18@5dd0b0bbe811a908374b2907bb38c75ca76127d2
Reviewed-on: https://github.com/flang-compiler/f18/pull/981
flang/lib/semantics/check-declarations.cpp
flang/lib/semantics/resolve-names.cpp
flang/test/semantics/CMakeLists.txt
flang/test/semantics/allocate01.f90
flang/test/semantics/allocate09.f90
flang/test/semantics/resolve44.f90
flang/test/semantics/resolve70.f90
flang/test/semantics/resolve71.f90 [new file with mode: 0644]
flang/test/semantics/symbol09.f90