diff --git a/libcxx/include/string b/libcxx/include/string index 8cbda52fa4ebbf..361d9b8dad8479 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -750,7 +750,7 @@ struct __init_with_sentinel_tag {}; #ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT template -struct __short_impl { +struct __short_layout_alternate { _CharT __data_[__min_cap]; unsigned char __padding_[_Padding]; unsigned char __size_ : 7; @@ -758,14 +758,14 @@ struct __short_impl { }; template -struct __short_impl<_CharT, __min_cap, 0> { +struct __short_layout_alternate<_CharT, __min_cap, 0> { _CharT __data_[__min_cap]; unsigned char __size_ : 7; unsigned char __is_long_ : 1; }; #else template -struct __short_impl { +struct __short_layout_classic { struct _LIBCPP_PACKED { unsigned char __is_long_ : 1; unsigned char __size_ : 7; @@ -774,7 +774,7 @@ struct __short_impl { _CharT __data_[__min_cap]; }; template -struct __short_impl<_CharT, __min_cap, 0> { +struct __short_layout_classic<_CharT, __min_cap, 0> { struct _LIBCPP_PACKED { unsigned char __is_long_ : 1; unsigned char __size_ : 7; @@ -929,7 +929,11 @@ private: #endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT - using __short = __short_impl; +#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT + using __short = __short_layout_alternate; +#else + using __short = __short_layout_classic; +#endif static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size."); union __rep {