]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix std::numeric_limits::lowest() test for strict modes
authorJonathan Wakely <jwakely@redhat.com>
Mon, 11 Oct 2021 12:28:32 +0000 (13:28 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 12 Oct 2021 10:45:45 +0000 (11:45 +0100)
commit60c20a314d57693a68e8c8a61d463202f229a954
treee8a22743ce44351e8e0d223cd2604f71349fab42
parent00967465fe8093661a4d42356821eeb04170e09d
libstdc++: Fix std::numeric_limits::lowest() test for strict modes

This test uses std::is_integral to decide whether we are testing an
integral or floating-point type. But that fails for __int128 because
is_integral<__int128> is false in strict modes. By using
numeric_limits::is_integer instead we get the right answer for all types
that have a numeric_limits specialization.

We can also simplify the test by removing the unnecessary tag
dispatching.

libstdc++-v3/ChangeLog:

* testsuite/18_support/numeric_limits/lowest.cc: Use
numeric_limits<T>::is_integer instead of is_integral<T>::value.

(cherry picked from commit 45ba5426c129993704a73e6ace4016eaa950d7ee)
libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc
This page took 0.060192 seconds and 5 git commands to generate.