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

Joe Loser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 14:32:04 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5758c824dab4: [ADT] Mark `llvm::array_lengthof` as deprecated (authored by jloser).

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
@@ -18,6 +18,8 @@
 
 #include <cstddef>
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 //===----------------------------------------------------------------------===//
@@ -26,7 +28,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.459202.patch
Type: text/x-patch
Size: 653 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220909/d772d1a3/attachment.bin>


More information about the llvm-commits mailing list