https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117257

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We could consider disabling those extensions for strict modes:

--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -1357,7 +1357,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef float value_type;
       typedef __complex__ float _ComplexT;

+#ifndef __STRICT_ANSI__
       _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
+#endif

       _GLIBCXX_CONSTEXPR complex(float __r = 0.0f, float __i = 0.0f)
 #if __cplusplus >= 201103L


But I don't think it's necessary. A conforming ISO C++ program cannot use the
type _Complex double, so can't call that constructor anyway.

It doesn't affect the std::is_constructible trait either, because you can't use
std::is_constructible<std::complex<double>, _Complex double> in a strict ISO
C++ program, and you can't use std::is_constructible to test whether
construction from an initializer-list {1.0, 1.0} works.

It's possible to write a concept or SFINAE check using {1.0, 1.0} but I can't
see it affecting real code, only contrived tests for checking strict
conformance.

Reply via email to