diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-08-20 18:07:32 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-08-23 13:18:19 +0100 |
commit | 0bb26524ae43ffe6a1e54941f467f59931f921b3 (patch) | |
tree | d67a6dc9ec3c98f2b5347f0b467295af93923aa1 /gcc/dwarf2codeview.cc | |
parent | b25b101bc380004b82e25d2b1ef306856c75d864 (diff) | |
download | gcc-0bb26524ae43ffe6a1e54941f467f59931f921b3.zip gcc-0bb26524ae43ffe6a1e54941f467f59931f921b3.tar.gz gcc-0bb26524ae43ffe6a1e54941f467f59931f921b3.tar.bz2 |
libstdc++: Simplify C++20 implementation of std::variant
For C++20 the __detail::__variant::_Uninitialized primary template can
be used for all types, because _Variant_union can have a non-trivially
destructible union member in C++20, and the constrained user-provided
destructor will ensure we don't destroy inactive objects.
Since we always use the primary template for C++20, we don't need the
_Uninitialized::_M_get accessors to abstract the difference between the
primary template and the partial specialization. That allows us to
simplify __get_n for C++20 too.
Also improve the comments that explain the uses of _Uninitialized and
when/why _Variant_union needs a user-provided destructor.
libstdc++-v3/ChangeLog:
* include/std/variant [C++20] (_Uninitialized): Always use the
primary template.
[C++20] (__get_n): Access the _M_storage member directly.
Diffstat (limited to 'gcc/dwarf2codeview.cc')
0 files changed, 0 insertions, 0 deletions