<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62844>62844</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libcxx] Use of std::aligned_storage deprecated in C++23
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aaronmondal
</td>
</tr>
</table>
<pre>
Building libcxx with C++23 emits a bunch of deprecation warnings due to the use of `std::aligned_storage` in a few libcxx sources.
This seems to be the only kind of warning triggered by C++23 though. (supported) Tests seem to pass as well 😊
```cpp
/home/aaron/aaronmondal/llvm-project/libcxx/src/include/sso_allocator.h:37:14: warning: 'aligned_storage<240>' is deprecated [-Wdeprecated-declarations]
typename aligned_storage<sizeof(_Tp) * _Np>::type buf_;
^
/home/aaron/aaronmondal/llvm-project/build/include/c++/v1/__memory/allocator_traits.h:238:33: note: in instantiation of template class 'std::__sso_allocator<std::locale::facet *, 30>' requested here
using value_type = typename allocator_type::value_type;
^
/home/aaron/aaronmondal/llvm-project/build/include/c++/v1/vector:390:22: note: in instantiation of template class 'std::allocator_traits<std::__sso_allocator<std::locale::facet *, 30>>' requested here
typedef typename __alloc_traits::size_type size_type;
^
/home/aaron/aaronmondal/llvm-project/libcxx/src/locale.cpp:138:49: note: in instantiation of template class 'std::vector<std::locale::facet *, std::__sso_allocator<std::locale::facet *, 30>>' requested here
vector<facet*, __sso_allocator<facet*, N> > facets_;
^
/home/aaron/aaronmondal/llvm-project/build/include/c++/v1/__type_traits/aligned_storage.h:86:8: note: 'aligned_storage<240>' has been explicitly marked deprecated here
struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage
^
/home/aaron/aaronmondal/llvm-project/build/include/c++/v1/__config:814:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX23'
# define _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_DEPRECATED
^
/home/aaron/aaronmondal/llvm-project/build/include/c++/v1/__config:775:49: note: expanded from macro '_LIBCPP_DEPRECATED'
# define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
^
```
cc @mordante @ldionne @philnik777
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8ll1v6ygTxz8NuRmdyIEkdi5y4bxJlc5TVc9md8-dhc04ZovBC7ht9tOvsPPanna7rbooLwTCMPz-42G4c3KnEedksiCT1YC3vjJ2zrk1ujZacDXIjdjPF61UQuodKJkXT0_wKH0FS0IXhC4oA6yld8Ahb3VRgSlBYGOx4F4aDY_caql3DkSL4A34CqF1GP5GppHzgrCUsJSr4InInDeW75BMI5AaOJT4eNzVmdYW6IYkWpEo7T-3lXTgEGsXbOfYmTda7eFeahE2OewP3srdDi0KyPcXvvvKtLtqCIQmrm0aYz0KQmewRed7y8Fww50D7uARlQKyichsQ2YJSdJLX8g06l9F0xxG6KYyNRK66ZAev3u0hG6Ueqi_Ndb8gYUPP7tzErpxtiB0I3WhWhFWO2cyrpQpuDd2WBGWspiwdDQmLD0eMHQJjZ9zZEs6jghbExqDdCdlUACZLL79fv79TWChuO1Ec2Sy6k8AAOD3DWpeI7y07eRfaEpCk2zbBGqEppDdNmG_TtWwFPK2zAhbnA2eGpmsPwQqD_F4RajoBSV08zAidJNlNdbG7oOhI7fMWy696_BRlgSILEDTxmP4lhqkdp5rL_vINSV4rBvFPUKhQgQQGp8CNsuuVAkwjlNhSGHfL3mBPnAhdAnsqITFP1t0QYUKLZ7JtC6E6gNXLWYdO8JWl_xPR9k3B_vn__4c8U_al1F_wKIjkbJZFCDTT-B9Ltsl34-jf5t-oCiwPAPP-k1OLgSrIeR7ba7aafhtGT7K_llq6I85DImGpaMumMezT9A-KvcOkF-uwsmXbuVh4cvNLmdvCVtDeHeD7pVs8472hQkpxMYxkEJWukqlXVJKpuHjUsV_yOcVd5AjasCnRslCerWHmtt7FJd5_kzXedsWHrLvN4vl3V22Wt_9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