[flang] Duplicate names for ac-implied-do variables erroneously cause errors
authorPeter Steinfeld <psteinfeld@nvidia.com>
Mon, 16 Nov 2020 20:06:44 +0000 (12:06 -0800)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 17 Nov 2020 02:57:13 +0000 (18:57 -0800)
commit681978d3b4e8fab98dd5c5c1f1687d3eff790a95
tree12e3183db33880356adb7ec3c2489d522f1ba7ee
parent3f4b5893efed620d93015896d79eb276628286f8
[flang] Duplicate names for ac-implied-do variables erroneously cause errors

According to section 19.4, paragraph 5, the scope of an ac-implied-do variable
is the enclosing ac-implied-do.  But we were not creating new scopes upon
entry to an ac-implied-do.  This was causing error messages to be erroneously
emitted.

I fixed, the code, added a test to array-constr-values.f90, added the test
folding15.f90 and corrected the test symbol05.f90.

Differential Revision: https://reviews.llvm.org/D91560
flang/lib/Semantics/resolve-names.cpp
flang/test/Evaluate/folding15.f90 [new file with mode: 0644]
flang/test/Semantics/array-constr-values.f90
flang/test/Semantics/symbol05.f90