]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Simplify std::any to fix -Wdeprecated-declarations warning
authorJonathan Wakely <jwakely@redhat.com>
Wed, 28 Aug 2024 12:07:47 +0000 (13:07 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 3 Sep 2024 14:08:44 +0000 (15:08 +0100)
commitdee3c5c6ff9952204af3014383593e8d316250e4
treec2f28ebde72efea7cd0f59b3200ea76e99de209e
parentefe6efb6f315c7f97be8a850e0a84ff7f6651d85
libstdc++: Simplify std::any to fix -Wdeprecated-declarations warning

We don't need to use std::aligned_storage in std::any. We just need a
POD type of the right size. The void* union member already ensures the
alignment will be correct. Avoiding std::aligned_storage means we don't
need to suppress a -Wdeprecated-declarations warning.

libstdc++-v3/ChangeLog:

* include/experimental/any (experimental::any::_Storage): Use
array of unsigned char instead of deprecated
std::aligned_storage.
* include/std/any (any::_Storage): Likewise.
* testsuite/20_util/any/layout.cc: New test.
libstdc++-v3/include/experimental/any
libstdc++-v3/include/std/any
libstdc++-v3/testsuite/20_util/any/layout.cc [new file with mode: 0644]