[flang-commits] [flang] [flang][acc] Disallow duplicate variables in use_device clause (PR #176217)
via flang-commits
flang-commits at lists.llvm.org
Thu Jan 15 10:36:34 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 -- flang/lib/Semantics/resolve-directives.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/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 48793e6c0..682f8f29b 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -341,8 +341,7 @@ public:
for (const auto &accObject : x.v.v) {
if (const auto *designator{
std::get_if<parser::Designator>(&accObject.u)}) {
- if (const auto *name{
- parser::GetDesignatorNameIfDataRef(*designator)}) {
+ if (const auto *name{parser::GetDesignatorNameIfDataRef(*designator)}) {
if (name->symbol) {
if (HasUseDeviceObject(*name->symbol)) {
context_.Say(name->source,
@@ -403,7 +402,9 @@ private:
Symbol &, const parser::OpenACCRoutineConstruct &);
// Track use_device variables
- void AddUseDeviceObject(SymbolRef object) { useDeviceObjects_.insert(object); }
+ void AddUseDeviceObject(SymbolRef object) {
+ useDeviceObjects_.insert(object);
+ }
void ClearUseDeviceObjects() { useDeviceObjects_.clear(); }
bool HasUseDeviceObject(const Symbol &object) {
return useDeviceObjects_.find(object) != useDeviceObjects_.end();
``````````
</details>
https://github.com/llvm/llvm-project/pull/176217
More information about the flang-commits
mailing list