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

Pete Steinfeld via flang-commits flang-commits at lists.llvm.org
Mon Feb 12 15:18:15 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)})
----------------
psteinfeld wrote:

I'm getting a warning on this line because the variable `directive` isn't used.  And since I have `-Werror` set, my build fails.

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


More information about the flang-commits mailing list