[libcxx-commits] [libcxx] [libc++][NFC] Mark random_device::__padding_ as [[maybe_unused]] (PR #206248)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 27 06:20:49 PDT 2026


https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/206248

>From 939f6bcad409668fea14a12d970346b9c1cd28f7 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Sat, 27 Jun 2026 15:18:49 +0200
Subject: [PATCH] [libc++][NFC] Mark random_device::__padding_ as
 [[maybe_unused]]

---
 libcxx/include/__random/random_device.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libcxx/include/__random/random_device.h b/libcxx/include/__random/random_device.h
index a8bb1e68e72f0..9da0b6172c9fb 100644
--- a/libcxx/include/__random/random_device.h
+++ b/libcxx/include/__random/random_device.h
@@ -28,19 +28,15 @@ class _LIBCPP_EXPORTED_FROM_ABI random_device {
 #  ifdef _LIBCPP_USING_DEV_RANDOM
   int __f_;
 #  elif !defined(_LIBCPP_ABI_NO_RANDOM_DEVICE_COMPATIBILITY_LAYOUT)
-  _LIBCPP_DIAGNOSTIC_PUSH
-  _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wunused-private-field")
-
   // Apple platforms used to use the `_LIBCPP_USING_DEV_RANDOM` code path, and now
   // use `arc4random()` as of this comment. In order to avoid breaking the ABI, we
   // retain the same layout as before.
 #    if defined(__APPLE__)
-  int __padding_; // padding to fake the `__f_` field above
+  [[__maybe_unused__]] int __padding_; // padding to fake the `__f_` field above
 #    endif
 
   // ... vendors can add workarounds here if they switch to a different representation ...
 
-  _LIBCPP_DIAGNOSTIC_POP
 #  endif
 
 public:



More information about the libcxx-commits mailing list