[flang-commits] [flang] [Flang][OpenMP] Prevent ICE for certain constructs in unnamed programs (PR #73938)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Dec 5 10:12:22 PST 2023


================
@@ -25,7 +25,7 @@
 template <typename T>
 static Fortran::semantics::Scope *GetScope(
     Fortran::semantics::SemanticsContext &context, const T &x) {
-  std::optional<Fortran::parser::CharBlock> source{GetSource(x)};
+  std::optional<Fortran::parser::CharBlock> source{GetLastSource(x)};
----------------
klausler wrote:

Why does this fix the bug?  Wouldn't it still fail when presented with a list or vector or tuple of parse tree nodes with a single element that would fail without this change?

https://github.com/llvm/llvm-project/pull/73938


More information about the flang-commits mailing list