[flang-commits] [flang] [flang][OpenMP] Fix crash in unparse-with-symbols for CRITICAL (PR #151962)

via flang-commits flang-commits at lists.llvm.org
Mon Aug 4 06:33:45 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- flang/lib/Semantics/unparse-with-symbols.cpp
``````````

</details>

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

``````````diff
diff --git a/flang/lib/Semantics/unparse-with-symbols.cpp b/flang/lib/Semantics/unparse-with-symbols.cpp
index 4548fbeba..3093e39ba 100644
--- a/flang/lib/Semantics/unparse-with-symbols.cpp
+++ b/flang/lib/Semantics/unparse-with-symbols.cpp
@@ -74,9 +74,7 @@ public:
     currStmt_ = x.source;
     return true;
   }
-  void Post(const parser::OmpCriticalDirective &) {
-    currStmt_ = std::nullopt;
-  }
+  void Post(const parser::OmpCriticalDirective &) { currStmt_ = std::nullopt; }
 
   bool Pre(const parser::OmpEndCriticalDirective &x) {
     currStmt_ = x.source;
@@ -91,17 +89,13 @@ public:
     currStmt_ = x.source;
     return true;
   }
-  void Post(const parser::OmpBeginDirective &) {
-    currStmt_ = std::nullopt;
-  }
+  void Post(const parser::OmpBeginDirective &) { currStmt_ = std::nullopt; }
 
   bool Pre(const parser::OmpEndDirective &x) {
     currStmt_ = x.source;
     return true;
   }
-  void Post(const parser::OmpEndDirective &) {
-    currStmt_ = std::nullopt;
-  }
+  void Post(const parser::OmpEndDirective &) { currStmt_ = std::nullopt; }
 
 private:
   std::optional<SourceName> currStmt_; // current statement we are processing

``````````

</details>


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


More information about the flang-commits mailing list