mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-10 14:40:08 +08:00
db55f1dda2
The following patch adds <complex> support for extended floating point types. C++23 removes the float/double/long double specializations from the spec and instead adds explicit(bool) specifier on the converting constructor. The patch uses that for converting constructor of the base template as well as the float/double/long double specializations's converting constructors (e.g. so that it handles convertion construction also from complex of extended floating point types). Copy ctor was already defaulted as the spec now requires. The patch also adds partial specialization for the _Float{16,32,64,128} and __gnu_cxx::__bfloat16_t types because the base template doesn't use __complex__ but a pair of floating point values. The g++.dg/cpp23/ testcase verifies explicit(bool) works correctly. 2022-10-31 Jakub Jelinek <jakub@redhat.com> gcc/testsuite/ * g++.dg/cpp23/ext-floating12.C: New test. libstdc++-v3/ * include/std/complex (complex::complex converting ctor): For C++23 use explicit specifier with constant expression. Explicitly cast both parts to _Tp. (__complex_abs, __complex_arg, __complex_cos, __complex_cosh, __complex_exp, __complex_log, __complex_sin, __complex_sinh, __complex_sqrt, __complex_tan, __complex_tanh, __complex_pow): Add __complex__ _Float{16,32,64,128} and __complex__ decltype(0.0bf16) overloads. (complex<float>::complex converting ctor, complex<double>::complex converting ctor, complex<long double>::complex converting ctor): For C++23 implement as template with explicit specifier with constant expression and explicit casts. (__complex_type): New template. (complex): New partial specialization for types with extended floating point types. (__complex_acos, __complex_asin, __complex_atan, __complex_acosh, __complex_asinh, __complex_atanh): Add __complex__ _Float{16,32,64,128} and __complex__ decltype(0.0bf16) overloads. (__complex_proj): Likewise. Add template for complex of extended floating point types. * include/bits/cpp_type_traits.h (__is_floating): Specialize for _Float{16,32,64,128} and __gnu_cxx::__bfloat16_t. * testsuite/26_numerics/complex/ext_c++23.cc: New test. |
||
---|---|---|
.. | ||
comparison_operators | ||
cons | ||
inserters_extractors | ||
literals | ||
operators | ||
requirements | ||
value_operations | ||
1.cc | ||
2.cc | ||
13450.cc | ||
50880.cc | ||
51083.cc | ||
56111.cc | ||
abi_tag.cc | ||
buggy_complex.cc | ||
c99.cc | ||
dr387_2.cc | ||
dr781.cc | ||
dr844.cc | ||
ext_c++23.cc | ||
pow.cc | ||
proj.cc |