[llvm] 7e2cf26 - [ADT] Clarify llvm::bit_cast implementation comment
Joe Loser via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 21 17:14:30 PDT 2022
Author: Joe Loser
Date: 2022-08-21T18:13:41-06:00
New Revision: 7e2cf2679ebc177c3264c171d8d7a91442161f5c
URL: https://github.com/llvm/llvm-project/commit/7e2cf2679ebc177c3264c171d8d7a91442161f5c
DIFF: https://github.com/llvm/llvm-project/commit/7e2cf2679ebc177c3264c171d8d7a91442161f5c.diff
LOG: [ADT] Clarify llvm::bit_cast implementation comment
When reviewing https://reviews.llvm.org/D132330, I noticed a few pre-existing
comments regarding the implementation of `llvm::bit_cast`. One comment is a bit
misleading since `std::bit_cast` is a C++20 standard library thing, not a
C++17 one (otherwise we could use it directly). Clarify that in the comment.
Differential Revision: https://reviews.llvm.org/D132332
Added:
Modified:
llvm/include/llvm/ADT/bit.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/bit.h b/llvm/include/llvm/ADT/bit.h
index 4a1bcfb05965..8e280db1927b 100644
--- a/llvm/include/llvm/ADT/bit.h
+++ b/llvm/include/llvm/ADT/bit.h
@@ -19,7 +19,7 @@
namespace llvm {
-// This implementation of bit_cast is
diff erent from the C++17 one in two ways:
+// This implementation of bit_cast is
diff erent from the C++20 one in two ways:
// - It isn't constexpr because that requires compiler support.
// - It requires trivially-constructible To, to avoid UB in the implementation.
template <
More information about the llvm-commits
mailing list