https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120235
Bug ID: 120235
Summary: std::fabs(const std::complex<T>&) should not be
defined
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
TR1 defined std::tr1::fabs (8.1.8 [tr.c99.cmplx.fabs]) but this is not present
in the C++ standard. We should not define it in <complex>:
template<typename _Tp>
inline _Tp
/// fabs(__z) [8.1.8].
// Effects: Behaves the same as C99 function cabs, defined
// in subclause 7.3.8.1.
fabs(const std::complex<_Tp>& __z)
{ return std::abs(__z); }
This should not compile:
#include <complex>
auto x = std::fabs(std::complex<double>{});