Skip to content

Commit

Permalink
Revert "[libc++][string] Remove potential non-trailing 0-length array (
Browse files Browse the repository at this point in the history
…#105865)"

This reverts commit ed0da00.
  • Loading branch information
mysterymath authored Sep 10, 2024
1 parent b5ce7a9 commit 72cfc74
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions libcxx/include/string
Original file line number Diff line number Diff line change
Expand Up @@ -749,14 +749,6 @@ struct __can_be_converted_to_string_view
struct __uninitialized_size_tag {};
struct __init_with_sentinel_tag {};

template <size_t _PaddingSize>
struct __padding {
char __padding_[_PaddingSize];
};

template <>
struct __padding<0> {};

template <class _CharT, class _Traits, class _Allocator>
class basic_string {
private:
Expand Down Expand Up @@ -861,7 +853,7 @@ private:

struct __short {
value_type __data_[__min_cap];
_LIBCPP_NO_UNIQUE_ADDRESS __padding<sizeof(value_type) - 1> __padding_;
unsigned char __padding_[sizeof(value_type) - 1];
unsigned char __size_ : 7;
unsigned char __is_long_ : 1;
};
Expand Down Expand Up @@ -913,7 +905,7 @@ private:
unsigned char __is_long_ : 1;
unsigned char __size_ : 7;
};
_LIBCPP_NO_UNIQUE_ADDRESS __padding<sizeof(value_type) - 1> __padding_;
char __padding_[sizeof(value_type) - 1];
value_type __data_[__min_cap];
};

Expand Down

0 comments on commit 72cfc74

Please sign in to comment.