[llvm] [ADT] Improve a comment in APInt.h (PR #156390)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 1 19:36:04 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-adt
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
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
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.
``````````
</details>
https://github.com/llvm/llvm-project/pull/156390
More information about the llvm-commits
mailing list