[flang] Perform more checks on array-specs
authorTim Keith <tkeith@nvidia.com>
Tue, 6 Aug 2019 20:48:13 +0000 (13:48 -0700)
committerTim Keith <tkeith@nvidia.com>
Wed, 7 Aug 2019 17:51:19 +0000 (10:51 -0700)
commit4887ae80cd9f4e2193ce2550873dbbf08bac3223
tree56dc91bd20332e45742bdf5cde8809d2a4403f0f
parent331c04cce60e585fc6e5cf715403afaaeaf84cbd
[flang] Perform more checks on array-specs

There are many constraints on what kind of array-specs can appear
in what contexts. Add `CheckArraySpec()` to perform most of them.
When the check fails, don't set the shape of the symbol being
declared and instead set the Error flag so we can avoid cascading
errors.

Fixes flang-compiler/f18#609.

Original-commit: flang-compiler/f18@f159d97f1f1e02b4d66e410b0f5a587f3c8fc51a
Reviewed-on: https://github.com/flang-compiler/f18/pull/630
Tree-same-pre-rewrite: false
flang/lib/parser/grammar.h
flang/lib/semantics/resolve-names.cc
flang/test/evaluate/CMakeLists.txt
flang/test/semantics/CMakeLists.txt
flang/test/semantics/resolve42.f90
flang/test/semantics/resolve58.f90 [new file with mode: 0644]