Skip to content

Conversation

shafik
Copy link
Collaborator

@shafik shafik commented Jun 11, 2025

Static analysis flagged that UntypedParameters could be moved instead of copied. This would avoid copying a large object.

Static analysis flagged that UntypedParameters could be moved instead of
copied. This would avoid copying a large object.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jun 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2025

@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)

Changes

Static analysis flagged that UntypedParameters could be moved instead of copied. This would avoid copying a large object.


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

1 Files Affected:

  • (modified) clang/lib/Sema/SemaExprCXX.cpp (+1-1)
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 2546ab5c0a342..c106ea749170f 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -2888,7 +2888,7 @@ static bool resolveAllocationOverload(
     // type-identity-less argument list.
     IAP.PassTypeIdentity = TypeAwareAllocationMode::No;
     IAP.PassAlignment = InitialAlignmentMode;
-    Args = UntypedParameters;
+    Args = std::move(UntypedParameters);
   }
   assert(!S.isStdTypeIdentity(Args[0]->getType(), nullptr));
   return resolveAllocationOverloadInterior(

@shafik shafik merged commit c2cb571 into llvm:main Jun 11, 2025
10 checks passed
@shafik shafik deleted the resolveAllocationOverloadMoveUntypedParameters branch June 11, 2025 18:59
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
Static analysis flagged that UntypedParameters could be moved instead of
copied. This would avoid copying a large object.
akuhlens pushed a commit to akuhlens/llvm-project that referenced this pull request Jun 24, 2025
Static analysis flagged that UntypedParameters could be moved instead of
copied. This would avoid copying a large object.
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