public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-10162] libstdc++: testsuite: Guard use of C99 std::log2 Date: Fri, 22 Jul 2022 07:07:40 +0000 (GMT) [thread overview] Message-ID: <20220722070740.D321F3835431@sourceware.org> (raw) https://gcc.gnu.org/g:0bc62cb594d6459005e439fcf7769ecaa48f59b2 commit r11-10162-g0bc62cb594d6459005e439fcf7769ecaa48f59b2 Author: Jonathan Wakely <jwakely@redhat.com> Date: Tue Jun 28 09:17:06 2022 +0100 libstdc++: testsuite: Guard use of C99 std::log2 This prevents the test from failing if the only thing not supported is the text printed to the log about the size of the floating-point type. libstdc++-v3/ChangeLog: * testsuite/20_util/from_chars/4.cc: Only use log2 if C99 math functions are available. (cherry picked from commit 30aea28bd30027e0a6be8e3077828256779954b3) Diff: --- libstdc++-v3/testsuite/20_util/from_chars/4.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/testsuite/20_util/from_chars/4.cc b/libstdc++-v3/testsuite/20_util/from_chars/4.cc index 7cee4dcbc23..4064f1d4177 100644 --- a/libstdc++-v3/testsuite/20_util/from_chars/4.cc +++ b/libstdc++-v3/testsuite/20_util/from_chars/4.cc @@ -300,9 +300,11 @@ test_max_mantissa() if (Float_limits::is_iec559 && Float_limits::digits < UInt_limits::digits) { +#ifdef _GLIBCXX_USE_C99_MATH_TR1 std::printf("Testing %d-bit float, using %zu-bit integer\n", Float_limits::digits + (int)std::log2(Float_limits::max_exponent) + 1, sizeof(UIntT) * __CHAR_BIT__); +#endif std::from_chars_result res; FloatT flt;
reply other threads:[~2022-07-22 7:07 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220722070740.D321F3835431@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).