[flang-commits] [flang] [Flang] Fix fixed-form OpenMP prescan for continuation lines (PR #213856)

via flang-commits flang-commits at lists.llvm.org
Tue Aug 4 00:27:46 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- flang/lib/Parser/prescan.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp
index 8fbe96889..cc58c5bd2 100644
--- a/flang/lib/Parser/prescan.cpp
+++ b/flang/lib/Parser/prescan.cpp
@@ -1694,15 +1694,15 @@ Prescanner::IsFixedFormCompilerDirectiveLine(const char *start) const {
     }
     ++column;
   }
-  const bool isOpenMPSentinelScan{
-      isOpenMPConditional ||
+  const bool isOpenMPSentinelScan{isOpenMPConditional ||
       (features_.IsEnabled(LanguageFeature::OpenMP) &&
           std::strcmp(sentinel, "$omp") == 0)};
   if (isOpenMPSentinelScan) {
     for (; column <= fixedFormColumnLimit_; ++column, ++p) {
       if (IsSpaceOrTab(p)) {
       } else if (*p == '!') {
-        return std::nullopt; // sentinel + blanks + ! is a comment, not a directive
+        return std::nullopt; // sentinel + blanks + ! is a comment, not a
+                             // directive
       } else {
         break;
       }

``````````

</details>


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


More information about the flang-commits mailing list