Skip to content

[Clang][NFC] Move UntypedParameters instead of copy #143646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

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
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
Static analysis flagged that UntypedParameters could be moved instead of
copied. This would avoid copying a large object.
@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