[flang] Avoid cascading error in subscript triplet
authorTim Keith <tkeith@nvidia.com>
Mon, 10 Aug 2020 18:44:04 +0000 (11:44 -0700)
committerTim Keith <tkeith@nvidia.com>
Mon, 10 Aug 2020 18:44:08 +0000 (11:44 -0700)
commit7f5928ef5a5743ee7e65c6c9d1e1c9bc6af03063
treec101f3fa9332ae4bdce3b4967d1fcec64feabdb7
parent189c0833dfd654f08a8655ca765e11e8890a92ae
[flang] Avoid cascading error in subscript triplet

If a bound of a subscript triplet is present but fails to analyze
due to an error, return nullopt rather than returning a Triplet with
that bound missing. This is so we can distinguish an absent bound from
an erroneous one and avoid spurious errors.

Differential Revision: https://reviews.llvm.org/D85672
flang/lib/Semantics/expression.cpp
flang/test/Semantics/assign04.f90