diff options
Diffstat (limited to 'flang/lib/Parser/unparse.cpp')
-rw-r--r-- | flang/lib/Parser/unparse.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp index 8ed1690..fc15d46 100644 --- a/flang/lib/Parser/unparse.cpp +++ b/flang/lib/Parser/unparse.cpp @@ -2898,11 +2898,13 @@ public: Put("\n"); EndOpenMP(); Walk(std::get<Block>(x.t), ""); - BeginOpenMP(); - Word("!$OMP END "); - Walk(std::get<OmpEndBlockDirective>(x.t)); - Put("\n"); - EndOpenMP(); + if (auto &&end{std::get<std::optional<OmpEndBlockDirective>>(x.t)}) { + BeginOpenMP(); + Word("!$OMP END "); + Walk(*end); + Put("\n"); + EndOpenMP(); + } } void Unparse(const OpenMPLoopConstruct &x) { BeginOpenMP(); |