[PATCH] D133502: [ADT] Mark `llvm::array_lengthof` as deprecated

Joe Loser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 13:25:39 PDT 2022


jloser updated this revision to Diff 458843.
jloser added a comment.

Placement of LLVM_DEPRECATED matters


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133502/new/

https://reviews.llvm.org/D133502

Files:
  llvm/include/llvm/ADT/STLArrayExtras.h


Index: llvm/include/llvm/ADT/STLArrayExtras.h
===================================================================
--- llvm/include/llvm/ADT/STLArrayExtras.h
+++ llvm/include/llvm/ADT/STLArrayExtras.h
@@ -26,7 +26,8 @@
 
 /// Find the length of an array.
 template <class T, std::size_t N>
-constexpr inline size_t array_lengthof(T (&)[N]) {
+constexpr inline LLVM_DEPRECATED("Use std::size instead.", "std::size") size_t
+    array_lengthof(T (&)[N]) {
   return N;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133502.458843.patch
Type: text/x-patch
Size: 471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220908/c705cdc5/attachment.bin>


More information about the llvm-commits mailing list