Skip to content

Commit 72cfc74

Browse files
authored
Revert "[libc++][string] Remove potential non-trailing 0-length array (llvm#105865)"
This reverts commit ed0da00.
1 parent b5ce7a9 commit 72cfc74

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

libcxx/include/string

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -749,14 +749,6 @@ struct __can_be_converted_to_string_view
749749
struct __uninitialized_size_tag {};
750750
struct __init_with_sentinel_tag {};
751751

752-
template <size_t _PaddingSize>
753-
struct __padding {
754-
char __padding_[_PaddingSize];
755-
};
756-
757-
template <>
758-
struct __padding<0> {};
759-
760752
template <class _CharT, class _Traits, class _Allocator>
761753
class basic_string {
762754
private:
@@ -861,7 +853,7 @@ private:
861853

862854
struct __short {
863855
value_type __data_[__min_cap];
864-
_LIBCPP_NO_UNIQUE_ADDRESS __padding<sizeof(value_type) - 1> __padding_;
856+
unsigned char __padding_[sizeof(value_type) - 1];
865857
unsigned char __size_ : 7;
866858
unsigned char __is_long_ : 1;
867859
};
@@ -913,7 +905,7 @@ private:
913905
unsigned char __is_long_ : 1;
914906
unsigned char __size_ : 7;
915907
};
916-
_LIBCPP_NO_UNIQUE_ADDRESS __padding<sizeof(value_type) - 1> __padding_;
908+
char __padding_[sizeof(value_type) - 1];
917909
value_type __data_[__min_cap];
918910
};
919911

0 commit comments

Comments
 (0)