diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-09-11 10:17:23 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-09-12 20:42:48 +0100 |
commit | 27c985b774b2ccb0d2aa9eb72acf05f98b790296 (patch) | |
tree | 1973d2fbd36364e5188eace2842673f1991bfbb5 /libbacktrace/zstdtest.c | |
parent | 9fe57e4879de93b6e3c7b4c226f42d5f3a48474f (diff) | |
download | gcc-27c985b774b2ccb0d2aa9eb72acf05f98b790296.zip gcc-27c985b774b2ccb0d2aa9eb72acf05f98b790296.tar.gz gcc-27c985b774b2ccb0d2aa9eb72acf05f98b790296.tar.bz2 |
libstdc++: Simplify std::launder definition
A single static assert is a much simpler way to implement the
compile-time preconditions on std::launder than an overload set of
deleted functions and function templates. The only difficulty is that
<new> doesn't include <type_traits> so we can't use std::is_function and
std::is_void for the checks. That can be worked around though, by using
the __is_same and __is_function built-ins. If the __is_function built-in
isn't supported then the __builtin_launder built-in will give an error
anyway, since the commit preceding this one.
We can also remove the redundant __cplusplus >= 201703L check around the
definitions of std::launder and the interference constants, which are
already guarded by the appropriate feature test macros.
libstdc++-v3/ChangeLog:
* libsupc++/new (launder): Add static_assert and remove deleted
overloads.
* testsuite/18_support/launder/requirements_neg.cc: Adjust
expected diagnostics.
Diffstat (limited to 'libbacktrace/zstdtest.c')
0 files changed, 0 insertions, 0 deletions