Skip to content

Conversation

@shafik
Copy link
Collaborator

@shafik shafik commented Apr 22, 2025

Static analysis flagged this use after move. It is undefined behavior and I don't see any possible performance gains here to attempt to do anything else but simply remove it.

Static analysis flagged this use after move. It is undefined behavior and
I don't see any possible performance gains here to attempt to do anything else
but simply remove it.
@shafik shafik added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Apr 22, 2025
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 22, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 22, 2025

@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)

Changes

Static analysis flagged this use after move. It is undefined behavior and I don't see any possible performance gains here to attempt to do anything else but simply remove it.


Full diff: https://github.com/llvm/llvm-project/pull/136728.diff

1 Files Affected:

  • (modified) clang/lib/Basic/DiagnosticIDs.cpp (+1-1)
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index d5928431f41a2..e2d940c0d39e9 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/lib/Basic/DiagnosticIDs.cpp
@@ -705,7 +705,7 @@ static void forEachSubGroupImpl(const WarningOption *Group, Func func) {
   for (const int16_t *SubGroups = DiagSubGroups + Group->SubGroups;
        *SubGroups != -1; ++SubGroups) {
     func(static_cast<size_t>(*SubGroups));
-    forEachSubGroupImpl(&OptionTable[*SubGroups], std::move(func));
+    forEachSubGroupImpl(&OptionTable[*SubGroups], func);
   }
 }
 

@shafik shafik merged commit 5e67476 into llvm:main Apr 22, 2025
14 checks passed
@shafik shafik deleted the remove_use_after_move_lambda_loop_diagid branch April 23, 2025 16:18
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Static analysis flagged this use after move. It is undefined behavior
and I don't see any possible performance gains here to attempt to do
anything else but simply remove it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants