]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix -Wunused-local-typedefs warning in <compare>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 4 Mar 2022 10:43:29 +0000 (10:43 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 4 Mar 2022 10:43:29 +0000 (10:43 +0000)
libstdc++-v3/ChangeLog:

* libsupc++/compare (strong_order::_S_fp_cmp): Move typedef
inside #if condition.

libstdc++-v3/libsupc++/compare

index a8747207b23557684ec25bdc02a5903ae1cdfb70..050cf7ed20d10cba3558806584758a675253bd7e 100644 (file)
@@ -850,8 +850,6 @@ namespace std
            return strong_ordering::equal; // All bits are equal, we're done.
 
          using enum _Fp_fmt;
-         using _Int = decltype(__ix);
-
          constexpr auto __fmt = _S_fp_fmt<_Tp>();
 
          if constexpr (__fmt == _Dbldbl) // double-double
@@ -899,6 +897,8 @@ namespace std
                  // bit to be reversed. Flip that to give desired ordering.
                  if (__builtin_isnan(__x) && __builtin_isnan(__y))
                    {
+                     using _Int = decltype(__ix);
+
                      constexpr int __nantype = __fmt == _Binary32  ?  22
                                              : __fmt == _Binary64  ?  51
                                              : __fmt == _Binary128 ? 111