--- libstdc++-v3/include/std/complex.jj	2022-10-31 20:15:49.756552019 +0100
+++ libstdc++-v3/include/std/complex	2022-11-12 01:56:42.970560123 +0100
@@ -598,6 +598,264 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return __z.imag(); }
 #endif
 
+#if _GLIBCXX_USE_C99_COMPLEX
+#if defined(__STDCPP_FLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
+  inline _Float16
+  __complex_abs(__complex__ _Float16 __z)
+  { return _Float16(__builtin_cabsf(__z)); }
+
+  inline _Float16
+  __complex_arg(__complex__ _Float16 __z)
+  { return _Float16(__builtin_cargf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_cos(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_ccosf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_cosh(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_ccoshf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_exp(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_cexpf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_log(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_clogf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_sin(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_csinf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_sinh(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_csinhf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_sqrt(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_csqrtf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_tan(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_ctanf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_tanh(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_ctanhf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_pow(__complex__ _Float16 __x, __complex__ _Float16 __y)
+  { return static_cast<__complex__ _Float16>(__builtin_cpowf(__x, __y)); }
+#endif
+
+#if defined(__STDCPP_FLOAT32_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
+  inline _Float32
+  __complex_abs(__complex__ _Float32 __z) { return __builtin_cabsf(__z); }
+
+  inline _Float32
+  __complex_arg(__complex__ _Float32 __z) { return __builtin_cargf(__z); }
+
+  inline __complex__ _Float32
+  __complex_cos(__complex__ _Float32 __z) { return __builtin_ccosf(__z); }
+
+  inline __complex__ _Float32
+  __complex_cosh(__complex__ _Float32 __z) { return __builtin_ccoshf(__z); }
+
+  inline __complex__ _Float32
+  __complex_exp(__complex__ _Float32 __z) { return __builtin_cexpf(__z); }
+
+  inline __complex__ _Float32
+  __complex_log(__complex__ _Float32 __z) { return __builtin_clogf(__z); }
+
+  inline __complex__ _Float32
+  __complex_sin(__complex__ _Float32 __z) { return __builtin_csinf(__z); }
+
+  inline __complex__ _Float32
+  __complex_sinh(__complex__ _Float32 __z) { return __builtin_csinhf(__z); }
+
+  inline __complex__ _Float32
+  __complex_sqrt(__complex__ _Float32 __z) { return __builtin_csqrtf(__z); }
+
+  inline __complex__ _Float32
+  __complex_tan(__complex__ _Float32 __z) { return __builtin_ctanf(__z); }
+
+  inline __complex__ _Float32
+  __complex_tanh(__complex__ _Float32 __z) { return __builtin_ctanhf(__z); }
+
+  inline __complex__ _Float32
+  __complex_pow(__complex__ _Float32 __x, __complex__ _Float32 __y)
+  { return __builtin_cpowf(__x, __y); }
+#endif
+
+#if defined(__STDCPP_FLOAT64_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
+  inline _Float64
+  __complex_abs(__complex__ _Float64 __z) { return __builtin_cabs(__z); }
+
+  inline _Float64
+  __complex_arg(__complex__ _Float64 __z) { return __builtin_carg(__z); }
+
+  inline __complex__ _Float64
+  __complex_cos(__complex__ _Float64 __z) { return __builtin_ccos(__z); }
+
+  inline __complex__ _Float64
+  __complex_cosh(__complex__ _Float64 __z) { return __builtin_ccosh(__z); }
+
+  inline __complex__ _Float64
+  __complex_exp(__complex__ _Float64 __z) { return __builtin_cexp(__z); }
+
+  inline __complex__ _Float64
+  __complex_log(__complex__ _Float64 __z) { return __builtin_clog(__z); }
+
+  inline __complex__ _Float64
+  __complex_sin(__complex__ _Float64 __z) { return __builtin_csin(__z); }
+
+  inline __complex__ _Float64
+  __complex_sinh(__complex__ _Float64 __z) { return __builtin_csinh(__z); }
+
+  inline __complex__ _Float64
+  __complex_sqrt(__complex__ _Float64 __z) { return __builtin_csqrt(__z); }
+
+  inline __complex__ _Float64
+  __complex_tan(__complex__ _Float64 __z) { return __builtin_ctan(__z); }
+
+  inline __complex__ _Float64
+  __complex_tanh(__complex__ _Float64 __z) { return __builtin_ctanh(__z); }
+
+  inline __complex__ _Float64
+  __complex_pow(__complex__ _Float64 __x, __complex__ _Float64 __y)
+  { return __builtin_cpow(__x, __y); }
+#endif
+
+#if defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
+  inline _Float128
+  __complex_abs(__complex__ _Float128 __z) { return __builtin_cabsl(__z); }
+
+  inline _Float128
+  __complex_arg(__complex__ _Float128 __z) { return __builtin_cargl(__z); }
+
+  inline __complex__ _Float128
+  __complex_cos(__complex__ _Float128 __z) { return __builtin_ccosl(__z); }
+
+  inline __complex__ _Float128
+  __complex_cosh(__complex__ _Float128 __z) { return __builtin_ccoshl(__z); }
+
+  inline __complex__ _Float128
+  __complex_exp(__complex__ _Float128 __z) { return __builtin_cexpl(__z); }
+
+  inline __complex__ _Float128
+  __complex_log(__complex__ _Float128 __z) { return __builtin_clogl(__z); }
+
+  inline __complex__ _Float128
+  __complex_sin(__complex__ _Float128 __z) { return __builtin_csinl(__z); }
+
+  inline __complex__ _Float128
+  __complex_sinh(__complex__ _Float128 __z) { return __builtin_csinhl(__z); }
+
+  inline __complex__ _Float128
+  __complex_sqrt(__complex__ _Float128 __z) { return __builtin_csqrtl(__z); }
+
+  inline __complex__ _Float128
+  __complex_tan(__complex__ _Float128 __z) { return __builtin_ctanl(__z); }
+
+  inline __complex__ _Float128
+  __complex_tanh(__complex__ _Float128 __z) { return __builtin_ctanhl(__z); }
+
+  inline __complex__ _Float128
+  __complex_pow(__complex__ _Float128 __x, __complex__ _Float128 __y)
+  { return __builtin_cpowl(__x, __y); }
+#elif defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_HAVE_FLOAT128_MATH)
+  inline _Float128
+  __complex_abs(__complex__ _Float128 __z) { return __builtin_cabsf128(__z); }
+
+  inline _Float128
+  __complex_arg(__complex__ _Float128 __z) { return __builtin_cargf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_cos(__complex__ _Float128 __z) { return __builtin_ccosf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_cosh(__complex__ _Float128 __z) { return __builtin_ccoshf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_exp(__complex__ _Float128 __z) { return __builtin_cexpf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_log(__complex__ _Float128 __z) { return __builtin_clogf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_sin(__complex__ _Float128 __z) { return __builtin_csinf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_sinh(__complex__ _Float128 __z) { return __builtin_csinhf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_sqrt(__complex__ _Float128 __z) { return __builtin_csqrtf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_tan(__complex__ _Float128 __z) { return __builtin_ctanf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_tanh(__complex__ _Float128 __z) { return __builtin_ctanhf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_pow(__complex__ _Float128 __x, __complex__ _Float128 __y)
+  { return __builtin_cpowf128(__x, __y); }
+#endif
+
+#if defined(__STDCPP_BFLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
+  inline __gnu_cxx::__bfloat16_t
+  __complex_abs(__complex__ decltype(0.0bf16) __z)
+  { return __gnu_cxx::__bfloat16_t(__builtin_cabsf(__z)); }
+
+  inline __gnu_cxx::__bfloat16_t
+  __complex_arg(__complex__ decltype(0.0bf16) __z)
+  { return __gnu_cxx::__bfloat16_t(__builtin_cargf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_cos(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ccosf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_cosh(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ccoshf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_exp(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cexpf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_log(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_clogf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_sin(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_csinf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_sinh(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_csinhf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_sqrt(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_csqrtf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_tan(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ctanf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_tanh(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ctanhf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_pow(__complex__ decltype(0.0bf16) __x,
+		__complex__ decltype(0.0bf16) __y)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cpowf(__x,
+								      __y)); }
+#endif
+#endif
+
   // 26.2.7/3 abs(__z):  Returns the magnitude of __z.
   template<typename _Tp>
     inline _Tp
@@ -1080,264 +1338,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	                 : std::pow(complex<_Tp>(__x), __y);
     }
 
-#if _GLIBCXX_USE_C99_COMPLEX
-#if defined(__STDCPP_FLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
-  inline _Float16
-  __complex_abs(__complex__ _Float16 __z)
-  { return _Float16(__builtin_cabsf(__z)); }
-
-  inline _Float16
-  __complex_arg(__complex__ _Float16 __z)
-  { return _Float16(__builtin_cargf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_cos(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_ccosf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_cosh(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_ccoshf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_exp(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_cexpf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_log(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_clogf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_sin(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_csinf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_sinh(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_csinhf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_sqrt(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_csqrtf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_tan(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_ctanf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_tanh(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_ctanhf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_pow(__complex__ _Float16 __x, __complex__ _Float16 __y)
-  { return static_cast<__complex__ _Float16>(__builtin_cpowf(__x, __y)); }
-#endif
-
-#if defined(__STDCPP_FLOAT32_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
-  inline _Float32
-  __complex_abs(__complex__ _Float32 __z) { return __builtin_cabsf(__z); }
-
-  inline _Float32
-  __complex_arg(__complex__ _Float32 __z) { return __builtin_cargf(__z); }
-
-  inline __complex__ _Float32
-  __complex_cos(__complex__ _Float32 __z) { return __builtin_ccosf(__z); }
-
-  inline __complex__ _Float32
-  __complex_cosh(__complex__ _Float32 __z) { return __builtin_ccoshf(__z); }
-
-  inline __complex__ _Float32
-  __complex_exp(__complex__ _Float32 __z) { return __builtin_cexpf(__z); }
-
-  inline __complex__ _Float32
-  __complex_log(__complex__ _Float32 __z) { return __builtin_clogf(__z); }
-
-  inline __complex__ _Float32
-  __complex_sin(__complex__ _Float32 __z) { return __builtin_csinf(__z); }
-
-  inline __complex__ _Float32
-  __complex_sinh(__complex__ _Float32 __z) { return __builtin_csinhf(__z); }
-
-  inline __complex__ _Float32
-  __complex_sqrt(__complex__ _Float32 __z) { return __builtin_csqrtf(__z); }
-
-  inline __complex__ _Float32
-  __complex_tan(__complex__ _Float32 __z) { return __builtin_ctanf(__z); }
-
-  inline __complex__ _Float32
-  __complex_tanh(__complex__ _Float32 __z) { return __builtin_ctanhf(__z); }
-
-  inline __complex__ _Float32
-  __complex_pow(__complex__ _Float32 __x, __complex__ _Float32 __y)
-  { return __builtin_cpowf(__x, __y); }
-#endif
-
-#if defined(__STDCPP_FLOAT64_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
-  inline _Float64
-  __complex_abs(__complex__ _Float64 __z) { return __builtin_cabs(__z); }
-
-  inline _Float64
-  __complex_arg(__complex__ _Float64 __z) { return __builtin_carg(__z); }
-
-  inline __complex__ _Float64
-  __complex_cos(__complex__ _Float64 __z) { return __builtin_ccos(__z); }
-
-  inline __complex__ _Float64
-  __complex_cosh(__complex__ _Float64 __z) { return __builtin_ccosh(__z); }
-
-  inline __complex__ _Float64
-  __complex_exp(__complex__ _Float64 __z) { return __builtin_cexp(__z); }
-
-  inline __complex__ _Float64
-  __complex_log(__complex__ _Float64 __z) { return __builtin_clog(__z); }
-
-  inline __complex__ _Float64
-  __complex_sin(__complex__ _Float64 __z) { return __builtin_csin(__z); }
-
-  inline __complex__ _Float64
-  __complex_sinh(__complex__ _Float64 __z) { return __builtin_csinh(__z); }
-
-  inline __complex__ _Float64
-  __complex_sqrt(__complex__ _Float64 __z) { return __builtin_csqrt(__z); }
-
-  inline __complex__ _Float64
-  __complex_tan(__complex__ _Float64 __z) { return __builtin_ctan(__z); }
-
-  inline __complex__ _Float64
-  __complex_tanh(__complex__ _Float64 __z) { return __builtin_ctanh(__z); }
-
-  inline __complex__ _Float64
-  __complex_pow(__complex__ _Float64 __x, __complex__ _Float64 __y)
-  { return __builtin_cpow(__x, __y); }
-#endif
-
-#if defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
-  inline _Float128
-  __complex_abs(__complex__ _Float128 __z) { return __builtin_cabsl(__z); }
-
-  inline _Float128
-  __complex_arg(__complex__ _Float128 __z) { return __builtin_cargl(__z); }
-
-  inline __complex__ _Float128
-  __complex_cos(__complex__ _Float128 __z) { return __builtin_ccosl(__z); }
-
-  inline __complex__ _Float128
-  __complex_cosh(__complex__ _Float128 __z) { return __builtin_ccoshl(__z); }
-
-  inline __complex__ _Float128
-  __complex_exp(__complex__ _Float128 __z) { return __builtin_cexpl(__z); }
-
-  inline __complex__ _Float128
-  __complex_log(__complex__ _Float128 __z) { return __builtin_clogl(__z); }
-
-  inline __complex__ _Float128
-  __complex_sin(__complex__ _Float128 __z) { return __builtin_csinl(__z); }
-
-  inline __complex__ _Float128
-  __complex_sinh(__complex__ _Float128 __z) { return __builtin_csinhl(__z); }
-
-  inline __complex__ _Float128
-  __complex_sqrt(__complex__ _Float128 __z) { return __builtin_csqrtl(__z); }
-
-  inline __complex__ _Float128
-  __complex_tan(__complex__ _Float128 __z) { return __builtin_ctanl(__z); }
-
-  inline __complex__ _Float128
-  __complex_tanh(__complex__ _Float128 __z) { return __builtin_ctanhl(__z); }
-
-  inline __complex__ _Float128
-  __complex_pow(__complex__ _Float128 __x, __complex__ _Float128 __y)
-  { return __builtin_cpowl(__x, __y); }
-#elif defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_HAVE_FLOAT128_MATH)
-  inline _Float128
-  __complex_abs(__complex__ _Float128 __z) { return __builtin_cabsf128(__z); }
-
-  inline _Float128
-  __complex_arg(__complex__ _Float128 __z) { return __builtin_cargf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_cos(__complex__ _Float128 __z) { return __builtin_ccosf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_cosh(__complex__ _Float128 __z) { return __builtin_ccoshf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_exp(__complex__ _Float128 __z) { return __builtin_cexpf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_log(__complex__ _Float128 __z) { return __builtin_clogf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_sin(__complex__ _Float128 __z) { return __builtin_csinf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_sinh(__complex__ _Float128 __z) { return __builtin_csinhf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_sqrt(__complex__ _Float128 __z) { return __builtin_csqrtf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_tan(__complex__ _Float128 __z) { return __builtin_ctanf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_tanh(__complex__ _Float128 __z) { return __builtin_ctanhf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_pow(__complex__ _Float128 __x, __complex__ _Float128 __y)
-  { return __builtin_cpowf128(__x, __y); }
-#endif
-
-#if defined(__STDCPP_BFLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
-  inline __gnu_cxx::__bfloat16_t
-  __complex_abs(__complex__ decltype(0.0bf16) __z)
-  { return __gnu_cxx::__bfloat16_t(__builtin_cabsf(__z)); }
-
-  inline __gnu_cxx::__bfloat16_t
-  __complex_arg(__complex__ decltype(0.0bf16) __z)
-  { return __gnu_cxx::__bfloat16_t(__builtin_cargf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_cos(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ccosf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_cosh(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ccoshf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_exp(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cexpf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_log(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_clogf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_sin(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_csinf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_sinh(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_csinhf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_sqrt(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_csqrtf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_tan(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ctanf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_tanh(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_ctanhf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_pow(__complex__ decltype(0.0bf16) __x,
-		__complex__ decltype(0.0bf16) __y)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cpowf(__x,
-								      __y)); }
-#endif
-#endif
-
   /// 26.2.3  complex specializations
   /// complex<float> specialization
   template<>
@@ -1835,7 +1835,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
 
   template<typename _Tp>
-    requires(__complex_type<_Tp>::type)
+    requires requires { typename __complex_type<_Tp>::type; }
     class complex<_Tp>
     {
     public:
@@ -2022,6 +2022,162 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 
 #if _GLIBCXX_USE_C99_COMPLEX_TR1
+#if defined(__STDCPP_FLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
+  inline __complex__ _Float16
+  __complex_acos(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_cacosf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_asin(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_casinf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_atan(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_catanf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_acosh(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_cacoshf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_asinh(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_casinhf(__z)); }
+
+  inline __complex__ _Float16
+  __complex_atanh(__complex__ _Float16 __z)
+  { return static_cast<__complex__ _Float16>(__builtin_catanhf(__z)); }
+#endif
+
+#if defined(__STDCPP_FLOAT32_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
+  inline __complex__ _Float32
+  __complex_acos(__complex__ _Float32 __z)
+  { return __builtin_cacosf(__z); }
+
+  inline __complex__ _Float32
+  __complex_asin(__complex__ _Float32 __z)
+  { return __builtin_casinf(__z); }
+
+  inline __complex__ _Float32
+  __complex_atan(__complex__ _Float32 __z)
+  { return __builtin_catanf(__z); }
+
+  inline __complex__ _Float32
+  __complex_acosh(__complex__ _Float32 __z)
+  { return __builtin_cacoshf(__z); }
+
+  inline __complex__ _Float32
+  __complex_asinh(__complex__ _Float32 __z)
+  { return __builtin_casinhf(__z); }
+
+  inline __complex__ _Float32
+  __complex_atanh(__complex__ _Float32 __z)
+  { return __builtin_catanhf(__z); }
+#endif
+
+#if defined(__STDCPP_FLOAT64_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
+  inline __complex__ _Float64
+  __complex_acos(__complex__ _Float64 __z)
+  { return __builtin_cacos(__z); }
+
+  inline __complex__ _Float64
+  __complex_asin(__complex__ _Float64 __z)
+  { return __builtin_casin(__z); }
+
+  inline __complex__ _Float64
+  __complex_atan(__complex__ _Float64 __z)
+  { return __builtin_catan(__z); }
+
+  inline __complex__ _Float64
+  __complex_acosh(__complex__ _Float64 __z)
+  { return __builtin_cacosh(__z); }
+
+  inline __complex__ _Float64
+  __complex_asinh(__complex__ _Float64 __z)
+  { return __builtin_casinh(__z); }
+
+  inline __complex__ _Float64
+  __complex_atanh(__complex__ _Float64 __z)
+  { return __builtin_catanh(__z); }
+#endif
+
+#if defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
+  inline __complex__ _Float128
+  __complex_acos(__complex__ _Float128 __z)
+  { return __builtin_cacosl(__z); }
+
+  inline __complex__ _Float128
+  __complex_asin(__complex__ _Float128 __z)
+  { return __builtin_casinl(__z); }
+
+  inline __complex__ _Float128
+  __complex_atan(__complex__ _Float128 __z)
+  { return __builtin_catanl(__z); }
+
+  inline __complex__ _Float128
+  __complex_acosh(__complex__ _Float128 __z)
+  { return __builtin_cacoshl(__z); }
+
+  inline __complex__ _Float128
+  __complex_asinh(__complex__ _Float128 __z)
+  { return __builtin_casinhl(__z); }
+
+  inline __complex__ _Float128
+  __complex_atanh(__complex__ _Float128 __z)
+  { return __builtin_catanhl(__z); }
+#elif defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_HAVE_FLOAT128_MATH)
+  inline __complex__ _Float128
+  __complex_acos(__complex__ _Float128 __z)
+  { return __builtin_cacosf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_asin(__complex__ _Float128 __z)
+  { return __builtin_casinf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_atan(__complex__ _Float128 __z)
+  { return __builtin_catanf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_acosh(__complex__ _Float128 __z)
+  { return __builtin_cacoshf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_asinh(__complex__ _Float128 __z)
+  { return __builtin_casinhf128(__z); }
+
+  inline __complex__ _Float128
+  __complex_atanh(__complex__ _Float128 __z)
+  { return __builtin_catanhf128(__z); }
+#endif
+
+#if defined(__STDCPP_BFLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
+  inline __complex__ decltype(0.0bf16)
+  __complex_acos(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cacosf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_asin(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_casinf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_atan(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_catanf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_acosh(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cacoshf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_asinh(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_casinhf(__z)); }
+
+  inline __complex__ decltype(0.0bf16)
+  __complex_atanh(__complex__ decltype(0.0bf16) __z)
+  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_catanhf(__z)); }
+#endif
+#endif
+
+#if _GLIBCXX_USE_C99_COMPLEX_TR1
   inline __complex__ float
   __complex_acos(__complex__ float __z)
   { return __builtin_cacosf(__z); }
@@ -2247,162 +2403,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return __complex_atanh(__z); }
 #endif
 
-#if _GLIBCXX_USE_C99_COMPLEX_TR1
-#if defined(__STDCPP_FLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
-  inline __complex__ _Float16
-  __complex_acos(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_cacosf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_asin(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_casinf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_atan(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_catanf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_acosh(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_cacoshf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_asinh(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_casinhf(__z)); }
-
-  inline __complex__ _Float16
-  __complex_atanh(__complex__ _Float16 __z)
-  { return static_cast<__complex__ _Float16>(__builtin_catanhf(__z)); }
-#endif
-
-#if defined(__STDCPP_FLOAT32_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
-  inline __complex__ _Float32
-  __complex_acos(__complex__ _Float32 __z)
-  { return __builtin_cacosf(__z); }
-
-  inline __complex__ _Float32
-  __complex_asin(__complex__ _Float32 __z)
-  { return __builtin_casinf(__z); }
-
-  inline __complex__ _Float32
-  __complex_atan(__complex__ _Float32 __z)
-  { return __builtin_catanf(__z); }
-
-  inline __complex__ _Float32
-  __complex_acosh(__complex__ _Float32 __z)
-  { return __builtin_cacoshf(__z); }
-
-  inline __complex__ _Float32
-  __complex_asinh(__complex__ _Float32 __z)
-  { return __builtin_casinhf(__z); }
-
-  inline __complex__ _Float32
-  __complex_atanh(__complex__ _Float32 __z)
-  { return __builtin_catanhf(__z); }
-#endif
-
-#if defined(__STDCPP_FLOAT64_T__) && defined(_GLIBCXX_DOUBLE_IS_IEEE_BINARY64)
-  inline __complex__ _Float64
-  __complex_acos(__complex__ _Float64 __z)
-  { return __builtin_cacos(__z); }
-
-  inline __complex__ _Float64
-  __complex_asin(__complex__ _Float64 __z)
-  { return __builtin_casin(__z); }
-
-  inline __complex__ _Float64
-  __complex_atan(__complex__ _Float64 __z)
-  { return __builtin_catan(__z); }
-
-  inline __complex__ _Float64
-  __complex_acosh(__complex__ _Float64 __z)
-  { return __builtin_cacosh(__z); }
-
-  inline __complex__ _Float64
-  __complex_asinh(__complex__ _Float64 __z)
-  { return __builtin_casinh(__z); }
-
-  inline __complex__ _Float64
-  __complex_atanh(__complex__ _Float64 __z)
-  { return __builtin_catanh(__z); }
-#endif
-
-#if defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
-  inline __complex__ _Float128
-  __complex_acos(__complex__ _Float128 __z)
-  { return __builtin_cacosl(__z); }
-
-  inline __complex__ _Float128
-  __complex_asin(__complex__ _Float128 __z)
-  { return __builtin_casinl(__z); }
-
-  inline __complex__ _Float128
-  __complex_atan(__complex__ _Float128 __z)
-  { return __builtin_catanl(__z); }
-
-  inline __complex__ _Float128
-  __complex_acosh(__complex__ _Float128 __z)
-  { return __builtin_cacoshl(__z); }
-
-  inline __complex__ _Float128
-  __complex_asinh(__complex__ _Float128 __z)
-  { return __builtin_casinhl(__z); }
-
-  inline __complex__ _Float128
-  __complex_atanh(__complex__ _Float128 __z)
-  { return __builtin_catanhl(__z); }
-#elif defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_HAVE_FLOAT128_MATH)
-  inline __complex__ _Float128
-  __complex_acos(__complex__ _Float128 __z)
-  { return __builtin_cacosf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_asin(__complex__ _Float128 __z)
-  { return __builtin_casinf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_atan(__complex__ _Float128 __z)
-  { return __builtin_catanf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_acosh(__complex__ _Float128 __z)
-  { return __builtin_cacoshf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_asinh(__complex__ _Float128 __z)
-  { return __builtin_casinhf128(__z); }
-
-  inline __complex__ _Float128
-  __complex_atanh(__complex__ _Float128 __z)
-  { return __builtin_catanhf128(__z); }
-#endif
-
-#if defined(__STDCPP_BFLOAT16_T__) && defined(_GLIBCXX_FLOAT_IS_IEEE_BINARY32)
-  inline __complex__ decltype(0.0bf16)
-  __complex_acos(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cacosf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_asin(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_casinf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_atan(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_catanf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_acosh(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_cacoshf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_asinh(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_casinhf(__z)); }
-
-  inline __complex__ decltype(0.0bf16)
-  __complex_atanh(__complex__ decltype(0.0bf16) __z)
-  { return static_cast<__complex__ decltype(0.0bf16)>(__builtin_catanhf(__z)); }
-#endif
-#endif
-
   template<typename _Tp>
     inline _Tp
     /// fabs(__z) [8.1.8].
