Skip to content

Conversation

kazutakahirata
Copy link
Contributor

@kazutakahirata kazutakahirata commented Sep 2, 2025

We don't have to remove this constructor if we are worried about
accidental binding. We can use "= delete" instead. Also, this patch
replaces "captured by" with "bound to" as that is more precise.

We don't have to remove this constructor if we are worried about
accidental binding.  We can use "= delete" instead.  Also, this patch
replaces "captured by" with "bound to" as that is more precise
terminology than "captured by".
@llvmbot
Copy link
Member

llvmbot commented Sep 2, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

We don't have to remove this constructor if we are worried about
accidental binding. We can use "= delete" instead. Also, this patch
replaces "captured by" with "bound to" as that is more precise
terminology than "captured by".


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

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/APInt.h (+3-3)
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index e68dc8bd14d96..9fa98ad4ddde1 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -151,9 +151,9 @@ class [[nodiscard]] APInt {
   /// deprecated because this constructor is prone to ambiguity with the
   /// APInt(unsigned, uint64_t, bool) constructor.
   ///
-  /// If this overload is ever deleted, care should be taken to prevent calls
-  /// from being incorrectly captured by the APInt(unsigned, uint64_t, bool)
-  /// constructor.
+  /// Once all uses of this constructor are migrated to other constructors,
+  /// consider marking this overload ""= delete" to prevent calls from being
+  /// incorrectly bound to the APInt(unsigned, uint64_t, bool) constructor.
   LLVM_ABI APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
 
   /// Construct an APInt from a string representation.

@kazutakahirata kazutakahirata merged commit 5e91314 into llvm:main Sep 2, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250901_APInt_comment branch September 2, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants