]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix up all_pedantic_errors.cc
authorJakub Jelinek <jakub@redhat.com>
Wed, 17 Dec 2025 08:16:46 +0000 (09:16 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 17 Dec 2025 08:49:03 +0000 (09:49 +0100)
On x86_64-linux I see
On x86_64-linux
FAIL: 17_intro/headers/c++1998/all_pedantic_errors.cc  -std=gnu++17 (test for excess errors)
Excess errors:
/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/random.tcc:3681: error: ISO C++ does not support '__int128' for 'type name' [-Wpedantic]
/home/jakub/src/gcc/obj20/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/random.tcc:3698: error: ISO C++ does not support '__int128' for 'type name' [-Wpedantic]
This fixes it by adding __extension__.

2025-12-17  Jakub Jelinek  <jakub@redhat.com>

* include/bits/random.tcc (std::generate_canonical): Use
__extension__ before __generate_canonical_{pow2,any} calls with
unsigned __int128 template arguments.

libstdc++-v3/include/bits/random.tcc

index 38e8645c88cbc51b37b2b45fd1d2eb9d92676618..e102e99eeb226470ee1e608ed99a1e3673ed59ad 100644 (file)
@@ -3677,7 +3677,7 @@ namespace __detail
            {
 #if defined(__SIZEOF_INT128__)
              // Accommodate double double or float128.
-             return __generate_canonical_pow2<
+             return __extension__ __generate_canonical_pow2<
                _RealT, unsigned __int128, __d>(__urng);
 #else
              static_assert(false,
@@ -3694,7 +3694,7 @@ namespace __detail
 #if defined(__SIZEOF_INT128__)
              static_assert(__d <= 64,
                "irregular RNG with float precision >64 is not supported");
-             return __generate_canonical_any<
+             return __extension__ __generate_canonical_any<
                _RealT, unsigned __int128, __d>(__urng);
 #else
              static_assert(false, "irregular RNG with float precision"