From 627463722c42ce033f8575ad41958f70bd3247db Mon Sep 17 00:00:00 2001 From: alesapin Date: Mon, 9 May 2022 12:22:56 +0200 Subject: [PATCH 1/2] Apply fix for gcc-12 --- include/string | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/include/string b/include/string index fd6a742..53795fa 100644 --- a/include/string +++ b/include/string @@ -635,21 +635,6 @@ struct __can_be_converted_to_string_view : public _BoolConstant< !is_convertible::value > {}; -#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT - -template -struct __padding -{ - unsigned char __xx[sizeof(_CharT)-1]; -}; - -template -struct __padding<_CharT, 1> -{ -}; - -#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT - #ifndef _LIBCPP_HAS_NO_CHAR8_T typedef basic_string u8string; #endif @@ -723,11 +708,8 @@ private: struct __short { value_type __data_[__min_cap]; - struct - : __padding - { - unsigned char __size_; - }; + unsigned char __padding[sizeof(value_type) - 1]; + unsigned char __size_; }; #else From e54c4c7adccee9a7806e0211ee44f2f22423a081 Mon Sep 17 00:00:00 2001 From: alesapin Date: Mon, 9 May 2022 19:26:48 +0200 Subject: [PATCH 2/2] Trying to check that gcc-12 can build clickhouse --- include/__hash_table | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/__hash_table b/include/__hash_table index adc732c..9462565 100644 --- a/include/__hash_table +++ b/include/__hash_table @@ -2063,7 +2063,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& size_type __bc = bucket_count(); bool __inserted = false; __next_pointer __nd; - size_t __chash; + // TODO remove me, just trying to make gcc-12 build this code. + size_t __chash = 0; if (__bc != 0) { __chash = __constrain_hash(__hash, __bc);