[flang] Allow exterior branch to outermost WHERE construct statement
authorPeter Klausler <pklausler@nvidia.com>
Wed, 10 Nov 2021 22:36:15 +0000 (14:36 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 11 Nov 2021 21:14:42 +0000 (13:14 -0800)
The labels of WHERE constructs were being created within the scope of
the construct, not the scope of its parent, leading to incorrect error
messages for branches to that label.

Differential Revision: https://reviews.llvm.org/D113696

flang/lib/Semantics/resolve-labels.cpp

index 2363c83..83c2ff7 100644 (file)
@@ -229,7 +229,8 @@ public:
     using LabeledConstructStmts = std::tuple<parser::AssociateStmt,
         parser::BlockStmt, parser::ChangeTeamStmt, parser::CriticalStmt,
         parser::IfThenStmt, parser::NonLabelDoStmt, parser::SelectCaseStmt,
-        parser::SelectRankStmt, parser::SelectTypeStmt>;
+        parser::SelectRankStmt, parser::SelectTypeStmt,
+        parser::WhereConstructStmt>;
     using LabeledConstructEndStmts = std::tuple<parser::EndAssociateStmt,
         parser::EndBlockStmt, parser::EndChangeTeamStmt,
         parser::EndCriticalStmt, parser::EndDoStmt, parser::EndForallStmt,