[libcxx-commits] [libcxx] [libc++] Remove potential 0-sized array in __compressed_pair_padding (PR #109028)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 30 00:25:25 PDT 2024


https://github.com/serge-sans-paille updated https://github.com/llvm/llvm-project/pull/109028

>From 312cb4e31473fca528f9ad797aa52b6576e39388 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton at mozilla.com>
Date: Wed, 18 Sep 2024 11:25:18 +0200
Subject: [PATCH] [libc++] Remove potential 0-sized array in
 __packed_format_arg_store

---
 libcxx/include/__format/format_arg_store.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libcxx/include/__format/format_arg_store.h b/libcxx/include/__format/format_arg_store.h
index 68e936acecade7..9a4a41df6d4e68 100644
--- a/libcxx/include/__format/format_arg_store.h
+++ b/libcxx/include/__format/format_arg_store.h
@@ -234,6 +234,11 @@ struct __packed_format_arg_store {
   uint64_t __types_ = 0;
 };
 
+template <class _Context>
+struct __packed_format_arg_store<_Context, 0> {
+  uint64_t __types_ = 0;
+};
+
 template <class _Context, size_t _Np>
 struct __unpacked_format_arg_store {
   basic_format_arg<_Context> __args_[_Np];



More information about the libcxx-commits mailing list