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.