[clang] [clang][parse] Fix assertion in template instantiation after invalid atomic statement (PR #245556)

via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 01:42:07 PST 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 -- clang/lib/Parse/ParseOpenACC.cpp clang/test/SemaOpenACC/atomic-construct.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/clang/lib/Parse/ParseOpenACC.cpp b/clang/lib/Parse/ParseOpenACC.cpp
index 25c1b7294..e0427713f 100644
--- a/clang/lib/Parse/ParseOpenACC.cpp
+++ b/clang/lib/Parse/ParseOpenACC.cpp
@@ -623,7 +623,7 @@ unsigned getOpenACCScopeFlags(OpenACCDirectiveKind DirKind) {
   case OpenACCDirectiveKind::Atomic:
     // the associated statement gets its own scope, so a declaration in it
     // (which is always invalid) cannot be referenced after the construct.
-     return Scope::DeclScope;
+    return Scope::DeclScope;
   case OpenACCDirectiveKind::Data:
   case OpenACCDirectiveKind::EnterData:
   case OpenACCDirectiveKind::ExitData:

``````````

</details>


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


More information about the cfe-commits mailing list