- marked as trivial
- changed title to std::aligned_storage deprecated in C++23
- changed component to General
- changed milestone to 2023.3.0 release
std::aligned_storage deprecated in C++23
Issue #541
new
C++23 deprecated std::aligned_storage
: http://wg21.link/p1413. We make use of this in several places and these should be replaced with equivalent code that won’t trigger warnings once compilers implement p1413.
Comments (4)
-
-
- changed milestone to Deferred indefinitely
Deferred until we see warnings with stakeholder interest
-
Issue
#606was marked as a duplicate of this issue. -
Extracted from issue 606, which I've closed as a dup of this one:
Testing of g++ 13.1.0 with
-std=c++23
yields the following warnings (truncated for brevity) when compiling even a trivial application such astest/hello_upcxx.cpp
:include/upcxx/future/core.hpp:388:43: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations] include/upcxx/serialization.hpp:1274:23: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations] include/upcxx/serialization.hpp:1767:23: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations] include/upcxx/utility.hpp:329:19: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations] include/upcxx/utility.hpp:379:19: warning: 'template<long unsigned int _Len, long unsigned int _Align> struct std::aligned_storage' is deprecated [-Wdeprecated-declarations]
- Log in to comment
As of release 2022.9.0
std::aligned_storage
has been removed from our training materials, and in many use cases replaced withstd::optional
.std::aligned_storage
is still used in a few tests (for deprecated or undocumented serialization interfaces), and internally by a several library headers/modules (notably insidedetail::raw_storage
). We should eventually remove the remaining references (at least in C++23 mode) to avoid warnings and comply with the capricious whims of the C++ committee.