[Bug libstdc++/79226] New: Additional overloads needed for __complex__ types
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 25 11:00:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79226
Bug ID: 79226
Summary: Additional overloads needed for __complex__ types
Product: gcc
Version: 6.3.1
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
This should compile:
#include <complex>
int main()
{
using namespace std::complex_literals;
std::real(0.0i);
std::imag(0.0i);
std::arg(0.0i);
std::norm(0.0i);
std::proj(0.0i);
std::conj(0.0i);
}
But using -std=gnu++NN the 'i' suffix is the GNU extension that creates
__complex__ double object, instead of the ISO C++ one that creates a
std::complex<double>, and there are no overloads for __complex__ double.
IMHO the GNU extension should be disabled in C++14 and above, because there's a
standardised way to do it (and users can run into similar ambiguities) but
until then we should make the code above DTRT.
More information about the Gcc-bugs
mailing list