[flang] Semantic checks for C709, C710, and C711
authorPete Steinfeld <psteinfeld@nvidia.com>
Fri, 14 Feb 2020 23:53:11 +0000 (15:53 -0800)
committerPete Steinfeld <psteinfeld@nvidia.com>
Wed, 19 Feb 2020 19:58:29 +0000 (11:58 -0800)
commit4d0c8522e3a3bd25c1783c1c271cb155240a7b75
tree7e6a38ccd5246117d5b1d470280f568e47ff004d
parentd49804cde510b12b1fab99a181779d4ff9380623
[flang] Semantic checks for C709, C710, and C711

C709 An assumed-type entity shall be a dummy data object that does not
have the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE
attribute and is not an explicit-shape array.

C710 An assumed-type variable name shall not appear in a designator or
expression except as an actual argument corresponding to a dummy
argument that is assumed-type, or as the first argument to the intrinsic
function IS_CONTIGUOUS, LBOUND, PRESENT, RANK, SHAPE, SIZE, or UBOUND,
or the function C_LOC from the intrinsic module ISO_C_BINDING.

C711 An assumed-type actual argument that corresponds to an assumed-rank
dummy argument shall be assumed-shape or assumed-rank.

For C709 I added code to check-declarations.cpp.  For this, I had to
distinguish between polymorphic types and assumed-type types to
eliminate multiple messages on the same line.

C710 was already checked, but I added a notation in the source.

For C711 I added code to check-call.cpp and the test call15.f90.

Original-commit: flang-compiler/f18@4a703f2b5a6484208a059dc0b456363c138a661d
Reviewed-on: https://github.com/flang-compiler/f18/pull/985
flang/include/flang/semantics/type.h
flang/lib/semantics/check-call.cpp
flang/lib/semantics/check-declarations.cpp
flang/lib/semantics/expression.cpp
flang/module/iso_c_binding.f90
flang/test/semantics/CMakeLists.txt
flang/test/semantics/call15.f90 [new file with mode: 0644]
flang/test/semantics/modfile12.f90
flang/test/semantics/resolve72.f90 [new file with mode: 0644]