[flang-commits] [flang] Skip compiler directives between OMP PARALLEL DO and the loop (PR #81021)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Tue Feb 13 05:40:06 PST 2024


================
@@ -90,7 +90,11 @@ class CanonicalizationOfOmp {
     auto &dir{std::get<parser::OmpLoopDirective>(beginDir.t)};
 
     nextIt = it;
-    if (++nextIt != block.end()) {
+    while (++nextIt != block.end()) {
+      // Ignore compiler directives.
+      if (auto *directive{GetConstructIf<parser::CompilerDirective>(*nextIt)})
----------------
Leporacanthicus wrote:

Apologies for that. Neither my GCC nor my Clang builds that I run warned for this - Trivial fix here:

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

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


More information about the flang-commits mailing list