[flang] Semantic checks for C702
authorPete Steinfeld <psteinfeld@nvidia.com>
Thu, 6 Feb 2020 20:26:51 +0000 (12:26 -0800)
committerPete Steinfeld <psteinfeld@nvidia.com>
Fri, 7 Feb 2020 18:26:23 +0000 (10:26 -0800)
commit05f44aff453a38324b1bf2a4aa9dc9d0834d944a
treeec999ae41d8fe574b3eaed977990400ce25a6f11
parentf90404e59c785f9ed6b456e9ff33f4fa90c9a88f
[flang] Semantic checks for C702
C702 (R701) A colon shall not be used as a type-param-value except in the
declaration of an entity that has the POINTER or ALLOCATABLE attribute.

I added code to the visitor for a TypeDeclarationStmt to check for the
'LEN' type parameter for strings and to loop over the type parameters
for derived types.

I also ran into a few situations where previous tests had erroneously
used a colon for type parameters without either the POINTER or
ALLOCATABLE attribute and fixed them up.

Original-commit: flang-compiler/f18@a1a95bfcd1811d697f1386fe57af664b8a16ffb5
Reviewed-on: https://github.com/flang-compiler/f18/pull/973
flang/lib/semantics/resolve-names.cpp
flang/test/evaluate/folding05.f90
flang/test/semantics/CMakeLists.txt
flang/test/semantics/allocate03.f90
flang/test/semantics/allocate09.f90
flang/test/semantics/modfile28.f90
flang/test/semantics/resolve37.f90
flang/test/semantics/resolve69.f90 [new file with mode: 0644]