Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2226756/?format=api
{ "id": 2226756, "url": "http://patchwork.ozlabs.org/api/patches/2226756/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhup2wemv2.gcc.gcc-TEST.redi.81.1.1@forge-stage.sourceware.org/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<bmm.hhup2wemv2.gcc.gcc-TEST.redi.81.1.1@forge-stage.sourceware.org>", "list_archive_url": null, "date": "2026-04-22T18:47:29", "name": "[v1,1/2] libstdc++: Implement Philox Engine (PR119794)", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "39f876b7398135eb828fb21f93280194d698162c", "submitter": { "id": 93210, "url": "http://patchwork.ozlabs.org/api/people/93210/?format=api", "name": "Jonathan Wakely via Sourceware Forge", "email": "forge-bot+redi@forge-stage.sourceware.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhup2wemv2.gcc.gcc-TEST.redi.81.1.1@forge-stage.sourceware.org/mbox/", "series": [ { "id": 501091, "url": "http://patchwork.ozlabs.org/api/series/501091/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501091", "date": "2026-04-22T18:47:29", "name": "WIP: philox", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501091/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2226756/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2226756/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org", "sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g18JF751sz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 05:22:53 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id F19E2436680C\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 19:22:51 +0000 (GMT)", "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id AD68E4332F24\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:48:50 +0000 (GMT)", "from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 89E2343545\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:48:50 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org F19E2436680C", "OpenDKIM Filter v2.11.0 sourceware.org AD68E4332F24" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org AD68E4332F24", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org AD68E4332F24", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776883730; cv=none;\n b=p1milWr9tDlpYJZOVHAelWOH6sdNAAVqFVyz5wdFTJOUepsNzzN08krh8B55BxZwjkRBXX7GOSFgkDa0pmaWkVu862J681HfY+UHjVI4/iLwz1uwNLBNofn1xHcrp18fMipSJPEesnUsFSDkgJNLPHeB+qPzVc8pX8yZjZ5u4AQ=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776883730; c=relaxed/simple;\n bh=a76Q3bY0U4IsPGXQn+jratG8gW7VSRJYLyVeldnn7CI=;\n h=From:Date:Subject:To:Message-ID;\n b=SVykRRboBY5p7XJoCAhFzVWGwyCLxgZLfWu4/a8t/xxjITlECB/2eI/dSf4bmiuO5XfXVmJQebG8g6/0Fk6Sv6hMmJzIWjAz43m4wQzOTZY+gMeSI0rFg0Zl3Bi2KsPeysqLYdGcNrXV+ecdPYfo5ZgzfTm3fMqvG87Y0oX23Yo=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "From": "Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>", "Date": "Wed, 22 Apr 2026 18:47:29 +0000", "Subject": "[PATCH v1 1/2] libstdc++: Implement Philox Engine (PR119794)", "To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>", "Message-ID": "\n <bmm.hhup2wemv2.gcc.gcc-TEST.redi.81.1.1@forge-stage.sourceware.org>", "X-Mailer": "batrachomyomachia", "X-Requested-Reviewer": "ppalka", "X-Pull-Request-Organization": "gcc", "X-Pull-Request-Repository": "gcc-TEST", "X-Pull-Request": "https://forge.sourceware.org/gcc/gcc-TEST/pulls/81", "References": "\n <bmm.hhup2wemv2.gcc.gcc-TEST.redi.81.1.0@forge-stage.sourceware.org>", "In-Reply-To": "\n <bmm.hhup2wemv2.gcc.gcc-TEST.redi.81.1.0@forge-stage.sourceware.org>", "X-Patch-URL": "\n https://forge.sourceware.org/redi/gcc/commit/55b15461b0f9f0ca2fcc12677c425bd9f48d6bf0", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Reply-To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>, redi@gcc.gnu.org", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "From: 1nfocalypse <1nfocalypse@protonmail.com>\n\nConforms with errata LWG4143, LWG4153 for Philox Engine.\n\n\tPR libstdc++/119794\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/random.h (philox_engine): Define.\n\t* include/bits/random.tcc (philox_engine): Define member\n\tfunctions.\n\t* include/bits/version.def (philox_engine): New macro.\n\t* include/bits/version.h: Regenerated.\n\t* include/std/random: Define __glibcxx_want_philox_engine and\n\tinclude <bits/version.h>.\n\t* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error\n\tline number.\n\t* testsuite/26_numerics/random/philox4x32.cc: New test.\n\t* testsuite/26_numerics/random/philox4x64.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/cons/119794.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/cons/copy.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/cons/default.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/cons/seed.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/cons/seed_seq.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/operators/equal.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/operators/inequal.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/operators/serialize.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/requirements/constants.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/requirements/constexpr_data.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/requirements/constexpr_functions.cc: New test.\n\t* testsuite/26_numerics/random/philox_engine/requirements/typedefs.cc: New test.\n---\n libstdc++-v3/include/bits/random.h | 283 ++++++++++++++++++\n libstdc++-v3/include/bits/random.tcc | 191 ++++++++++++\n libstdc++-v3/include/bits/version.def | 9 +\n libstdc++-v3/include/bits/version.h | 10 +\n libstdc++-v3/include/std/random | 3 +\n .../26_numerics/random/philox4x32.cc | 23 ++\n .../26_numerics/random/philox4x64.cc | 23 ++\n .../random/philox_engine/cons/119794.cc | 39 +++\n .../random/philox_engine/cons/copy.cc | 25 ++\n .../random/philox_engine/cons/default.cc | 27 ++\n .../random/philox_engine/cons/seed.cc | 20 ++\n .../random/philox_engine/cons/seed_seq.cc | 24 ++\n .../random/philox_engine/operators/equal.cc | 30 ++\n .../random/philox_engine/operators/inequal.cc | 30 ++\n .../philox_engine/operators/serialize.cc | 49 +++\n .../philox_engine/requirements/constants.cc | 26 ++\n .../requirements/constexpr_data.cc | 50 ++++\n .../requirements/constexpr_functions.cc | 41 +++\n .../philox_engine/requirements/typedefs.cc | 26 ++\n .../26_numerics/random/pr60037-neg.cc | 4 +-\n 20 files changed, 931 insertions(+), 2 deletions(-)\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox4x32.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox4x64.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/119794.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/copy.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/default.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed_seq.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/equal.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/inequal.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/serialize.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constants.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_data.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_functions.cc\n create mode 100644 libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/typedefs.cc", "diff": "diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h\nindex 1fdaf51934fd..e74b7bd75c03 100644\n--- a/libstdc++-v3/include/bits/random.h\n+++ b/libstdc++-v3/include/bits/random.h\n@@ -33,6 +33,7 @@\n \n #include <vector>\n #include <bits/uniform_int_dist.h>\n+#include <iomanip>\n \n namespace std _GLIBCXX_VISIBILITY(default)\n {\n@@ -1688,6 +1689,270 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n { return !(__lhs == __rhs); }\n #endif\n \n+#if __cpp_lib_philox_engine\n+\n+ /**\n+ * @brief: A discrete pseudorandom number generator based off of weakened\n+ * cryptographic primitives.\n+ *\n+ * This algorithm was intended to be used for highly parallel random number\n+ * generation, and is capable of immensely long periods. It provides \"Crush-\n+ * resistance\", denoting an ability to pass the TestU01 Suite's \"Big Crush\"\n+ * test, demonstrating significant apparent entropy. It is not intended for\n+ * cryptographic use and should not be used for such, despite being based on\n+ * cryptographic primitives.\n+ *\n+ * The two four-word definitions are likely the best use for this algorithm,\n+ * and are given below as defaults.\n+ *\n+ * This algorithm was created by John Salmon, Mark Moraes, Ron Dror, and\n+ * David Shaw as a product of D.E. Shaw Research.\n+ *\n+ * @tparam __w \tWord size\n+ * @tparam __n \tBuffer size\n+ * @tparam __r \tRounds\n+ * @tparam __consts\tMultiplication and round constant pack, ordered as\n+ * \t\t\tM_{0}, C_{0}, M_{1}, C_{1}, ... , M_{N/2-1}, C_{N/2-1}\n+ *\n+ * @headerfile random\n+ * @since C++26\n+ */\n+ template<class _UIntType, size_t __w,\n+\t size_t __n, size_t __r,\n+\t _UIntType... __consts>\n+ class philox_engine\n+ {\n+ static_assert(__n == 2 || __n == 4,\n+\t \"template argument N must be either 2 or 4\");\n+ static_assert(sizeof...(__consts) == __n,\n+\t \"length of consts array must match specified N\");\n+ static_assert(0 < __r, \"a number of rounds must be specified\");\n+ static_assert((0 < __w && __w <= numeric_limits<_UIntType>::digits),\n+\t \"specified bitlength must match input type\");\n+ template<typename _Sseq>\n+\tusing _If_seed_seq\n+\t = __detail::_If_seed_seq_for<_Sseq, philox_engine, _UIntType>;\n+\n+ private:\n+\t// the ordering here is essential to functionality.\n+\t/** @brief an internal unpacking function for %philox_engine. */\n+\ttemplate <size_t __ind0, size_t __ind1>\n+\t static constexpr\n+\t array<_UIntType, __n / 2>\n+\t _S_popArray()\n+\t {\n+\t if constexpr (__n == 4)\n+\t return {__consts...[__ind0], __consts...[__ind1]};\n+\t else\n+\t return {__consts...[__ind0]};\n+\t }\n+\n+ public:\n+\t/** Type of template param. */\n+\tusing result_type = _UIntType;\n+\t// public members\n+\tstatic constexpr size_t word_size = __w;\n+\tstatic constexpr size_t word_count = __n;\n+\tstatic constexpr size_t round_count = __r;\n+\tstatic constexpr array<result_type, __n / 2> multipliers =\n+\t philox_engine::_S_popArray<0,2>();\n+\tstatic constexpr array<result_type, __n / 2> round_consts =\n+\t philox_engine::_S_popArray<1,3>();\n+\n+\t/** @brief returns the minimum value possible. */\n+\tstatic constexpr result_type\n+\tmin()\n+\t{ return 0; }\n+\n+\t/** @brief returns the maximum value possible. */\n+\tstatic constexpr result_type\n+\tmax()\n+\t{\n+\t return ((1ull << (__w - 1)) | ((1ull << (__w - 1)) - 1));\n+\t}\n+\t// default key value\n+\tstatic constexpr result_type default_seed = 20111115u;\n+\n+\t// constructors\n+\tphilox_engine()\n+\t: philox_engine(default_seed)\n+\t{}\n+\n+\texplicit\n+\tphilox_engine(result_type __value);\n+\n+\t/** @brief seed sequence constructor for %philox_engine\n+\t *\n+\t * @params __q the seed sequence\n+\t */\n+\ttemplate<typename _Sseq, typename = _If_seed_seq<_Sseq>>\n+\t explicit\n+\t philox_engine(_Sseq& __q)\n+\t {\n+\t seed(__q);\n+\t }\n+\n+\tvoid\n+\tseed(result_type value = default_seed);\n+\n+\t/** @brief seeds %philox_engine by seed sequence\n+\t *\n+\t * @params __q the seed sequence\n+\t */\n+\ttemplate<typename _Sseq>\n+\t _If_seed_seq<_Sseq>\n+\t seed(_Sseq& __q);\n+\n+\t/** @brief sets the internal counter \"cleartext\"\n+\t *\n+\t * @params __counter std::array of len N\n+\t */\n+\tvoid\n+\tset_counter(const array<result_type, __n>& __counter);\n+\n+\t/** @brief compares two %philox_engine objects\n+\t *\n+\t * @params __x A %philox_engine object\n+\t * @params __y A %philox_engine object\n+\t *\n+\t * @returns true if the objects will produce an identical stream, false\n+\t * otherwise\n+\t */\n+\tfriend bool\n+\toperator==(const philox_engine& __x, const philox_engine& __y)\n+\t{\n+\t return (std::equal(__x._M_x.begin(), __x._M_x.end(),\n+\t\t__y._M_x.begin(), __y._M_x.end())\n+\t && std::equal(__x._M_y.begin(), __x._M_y.end(),\n+\t\t__y._M_y.begin(), __y._M_y.end())\n+\t && std::equal(__x._M_k.begin(), __x._M_k.end(),\n+\t\t__y._M_k.begin(), __y._M_k.end())\n+\t && __x._M_i == __y._M_i);\n+\t}\n+\n+\t/** @brief outputs a single w-bit number and handles state advancement\n+\t *\n+\t * @returns return_type\n+\t */\n+\t_UIntType\n+\toperator()();\n+\n+\t/** @brief discards __z numbers\n+\t *\n+\t * @params __z number of iterations to discard\n+\t */\n+\tvoid\n+\tdiscard(unsigned long long __z);\n+\n+\t/** @brief outputs the state of the generator\n+\t *\n+\t * @param __os An output stream.\n+\t * @param __x A %philox_engine object reference\n+\t *\n+\t * @returns the state of the Philox Engine in __os\n+\t */\n+\ttemplate<typename _CharT, typename _Traits>\n+\t friend basic_ostream<_CharT, _Traits>&\n+\t operator<<(basic_ostream<_CharT, _Traits>& __os,\n+\t const philox_engine& __x)\n+\t {\n+\t\tconst typename ios_base::fmtflags __flags = __os.flags();\n+\t\tconst _CharT __fill = __os.fill();\n+\t\t__os.flags(ios_base::dec | ios_base::left);\n+\t\t__os.fill(__os.widen(' '));\n+\t\tfor (auto &__subkey : __x._M_k)\n+\t\t __os << __subkey << ' ';\n+\t\tfor (auto &__ctr : __x._M_x)\n+\t\t __os << __ctr << ' ';\n+\t\t__os << __x._M_i;\n+\t\t__os.flags(__flags);\n+\t\t__os.fill(__fill);\n+\t\treturn __os;\n+\t }\n+\n+\t/** @brief takes input to set the state of the %philox_engine object\n+\t *\n+\t * @param __is An input stream.\n+\t * @param __x A %philox_engine object reference\n+\t *\n+\t * @returns %philox_engine object is set with values from instream\n+\t */\n+\ttemplate <typename _CharT, typename _Traits>\n+\t friend basic_istream<_CharT, _Traits>&\n+\t operator>>(basic_istream<_CharT, _Traits>& __is,\n+\t philox_engine& __x)\n+\t {\n+\t\tconst typename ios_base::fmtflags __flags = __is.flags();\n+\t\t__is.flags(ios_base::dec | ios_base::skipws);\n+\t\tfor (auto &__subkey : __x._M_k)\n+\t\t __is >> __subkey;\n+\t\tfor (auto &__ctr : __x._M_x)\n+\t\t __is >> __ctr;\n+\t\tarray<_UIntType, __n> __tmpCtr = __x._M_x;\n+\t\tunsigned char __setIndex = 0;\n+\t\tfor (size_t __j = 0; __j < __x._M_x.size(); ++__j)\n+\t\t{\n+\t\t if (__x._M_x[__j] > 0)\n+\t\t {\n+\t\t __setIndex = __j;\n+\t\t break;\n+\t\t }\n+\t\t}\n+\t\tfor (size_t __j = 0; __j <= __setIndex; ++__j)\n+\t\t{\n+\t\t if (__j != __setIndex)\n+\t\t __x._M_x[__j] = max();\n+\t\t else\n+\t\t --__x._M_x[__j];\n+\t\t}\n+\t\t__x._M_philox();\n+\t\t__x._M_x = __tmpCtr;\n+\t\t__is >> __x._M_i;\n+\t\t__is.flags(__flags);\n+\t\treturn __is;\n+\t }\n+ private:\n+\t// private state variables\n+\tarray<_UIntType, __n> _M_x;\n+\tarray<_UIntType, __n / 2> _M_k;\n+\tarray<_UIntType, __n> _M_y;\n+\tunsigned long long _M_i = 0;\n+\n+\t/** @brief Takes the high values of the product of __a, __b\n+\t *\n+\t * @params __a an unsigned integer\n+\t * @params __b an unsigned integer\n+\t *\n+\t * @returns an unsigned integer of at most bitlength W\n+\t */\n+\tstatic\n+\t_UIntType\n+\t_S_mulhi(_UIntType __a, _UIntType __b); // (A*B)/2^W\n+\n+\t/** @brief Takes the low values of the product of __a, __b\n+\t *\n+\t * @params __a an unsigned integer\n+\t * @params __b an unsigned integer\n+\t *\n+\t * @returns an unsigned integer of at most bitlength W\n+\t */\n+\tstatic\n+\t_UIntType\n+\t_S_mullo(_UIntType __a, _UIntType __b); // (A*B)%2^W\n+\n+\t/** @brief an R-round substitution/Feistel Network hybrid for\n+\t * %philox_engine\n+\t */\n+\tvoid\n+\t_M_philox();\n+\n+\t/** @brief an internal transition function for the %philox_engine. */\n+\tvoid\n+\t_M_transition();\n+ };\n+\n+#endif\n+\n /**\n * The classic Minimum Standard rand0 of Lewis, Goodman, and Miller.\n */\n@@ -1742,6 +2007,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \n typedef minstd_rand0 default_random_engine;\n \n+#if __cpp_lib_philox_engine\n+\n+ typedef philox_engine<\n+ uint_fast32_t,\n+ 32, 4, 10,\n+ 0xCD9E8D57, 0x9E3779B9,\n+ 0xD2511F53, 0xBB67AE85> philox4x32;\n+\n+ /**\n+ * Alternative Philox instance (64 bit)\n+ */\n+ typedef philox_engine<\n+ uint_fast64_t,\n+ 64, 4, 10,\n+ 0xCA5A826395121157, 0x9E3779B97F4A7C15,\n+ 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B> philox4x64;\n+#endif\n+\n /**\n * A standard interface to a platform-specific non-deterministic\n * random number generator (if any are available).\ndiff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc\nindex 53ccacb2e38b..53f302da8007 100644\n--- a/libstdc++-v3/include/bits/random.tcc\n+++ b/libstdc++-v3/include/bits/random.tcc\n@@ -907,6 +907,197 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n return __is;\n }\n \n+#if __cpp_lib_philox_engine\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ _UIntType\n+ philox_engine<_UIntType,\n+ __w, __n, __r, __consts...>::_S_mulhi(_UIntType __a, _UIntType __b)\n+ {\n+ const __uint128_t __num =\n+\tstatic_cast<__uint128_t>(__a) * static_cast<__uint128_t>(__b);\n+ return static_cast<_UIntType>((__num >> __w) & max());\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ _UIntType\n+ philox_engine<_UIntType,\n+ __w, __n, __r, __consts...>::_S_mullo(_UIntType __a, _UIntType __b)\n+ {\n+ return static_cast<_UIntType>((__a * __b) & max());\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ void\n+ philox_engine<_UIntType, __w, __n, __r, __consts...>::_M_transition()\n+ {\n+ ++_M_i;\n+ if (_M_i == __n)\n+ {\n+ _M_philox();\n+ if constexpr (__n == 4)\n+ {\n+\t__uint128_t __uh =\n+\t (static_cast<__uint128_t>(_M_x[1]) << __w)\n+\t\t| (static_cast<__uint128_t>(_M_x[0]) + 1);\n+\t__uint128_t __lh =\n+\t ((static_cast<__uint128_t>(_M_x[3]) << __w)\n+\t\t| (_M_x[2]));\n+\t__uint128_t __bigMask =\n+\t (static_cast<__uint128_t>(1) << ((2 * __w) - 1))\n+\t | ((static_cast<__uint128_t>(1) << ((2 * __w) - 1)) - 1);\n+\tif ((__uh & __bigMask) == 0)\n+\t{\n+\t ++__lh;\n+\t __uh = 0;\n+\t}\n+\t_M_x[0] = __uh & max();\n+\t_M_x[1] = (__uh >> (__w)) & max();\n+\t_M_x[2] = __lh & max();\n+\t_M_x[3] = (__lh >> (__w)) & max();\n+ } else\n+ {\n+\t__uint128_t __num =\n+\t\t(static_cast<__uint128_t>(_M_x[1]) << __w)\n+\t\t| (static_cast<__uint128_t>(_M_x[0]) + 1);\n+\t_M_x[0] = __num & max();\n+\t_M_x[1] = (__num >> __w) & max();\n+ }\n+ _M_i = 0;\n+ }\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ void\n+ philox_engine<_UIntType, __w, __n, __r, __consts...>::_M_philox()\n+ {\n+ array<_UIntType, __n> __outputSeq{};\n+ for (size_t __j = 0; __j < __n; ++__j)\n+ __outputSeq[__j] = _M_x[__j];\n+ for (unsigned long __j = 0; __j < __r; ++__j)\n+ {\n+ array<_UIntType, __n> __intermedSeq{};\n+ if constexpr (__n == 4)\n+ {\n+\t__intermedSeq[0] = __outputSeq[2];\n+\t__intermedSeq[1] = __outputSeq[1];\n+\t__intermedSeq[2] = __outputSeq[0];\n+\t__intermedSeq[3] = __outputSeq[3];\n+ } else\n+ {\n+\t__intermedSeq[0] = __outputSeq[0];\n+\t__intermedSeq[1] = __outputSeq[1];\n+ }\n+ for (unsigned long __k = 0; __k < (__n/2); ++__k)\n+ {\n+\t__outputSeq[2*__k]= _S_mulhi(__intermedSeq[2*__k], multipliers[__k])\n+\t ^ (((_M_k[__k] + (__j * round_consts[__k])) & max()))\n+\t ^ __intermedSeq[2*__k+1];\n+\n+\t__outputSeq[(2*__k)+1]= _S_mullo(__intermedSeq[2*__k],\n+\t multipliers[__k]);\n+ }\n+ }\n+ for (unsigned long __j = 0; __j < __n; ++__j)\n+ _M_y[__j] = __outputSeq[__j];\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ philox_engine<_UIntType,\n+\t__w, __n, __r, __consts...>::philox_engine(result_type __value)\n+ {\n+ std::fill(_M_x.begin(), _M_x.end(), 0);\n+ std::fill(_M_k.begin(), _M_k.end(), 0);\n+ std::fill(_M_y.begin(), _M_y.end(), 0);\n+ _M_k[0] = __value & max();\n+ _M_i = __n - 1;\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ void\n+ philox_engine<_UIntType,\n+ __w, __n, __r, __consts...>::seed(result_type __value)\n+ {\n+ std::fill(_M_x.begin(), _M_x.end(), 0);\n+ std::fill(_M_k.begin(), _M_k.end(), 0);\n+ std::fill(_M_y.begin(), _M_y.end(), 0);\n+ _M_k[0] = __value & max();\n+ _M_i = __n - 1;\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ void\n+ philox_engine<_UIntType, __w,\n+ __n, __r, __consts...>::set_counter(const array<result_type, __n>& __counter)\n+ {\n+ for (unsigned long long __j = 0; __j < __n; ++__j)\n+ _M_x[__j] = __counter[__n - 1 - __j] & max();\n+ _M_i = __n - 1;\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ template<typename _Sseq>\n+ auto\n+ philox_engine<_UIntType, __w, __n, __r, __consts...>::seed(_Sseq& __q)\n+ -> _If_seed_seq<_Sseq>\n+ {\n+ std::fill(_M_k.begin(), _M_k.end(), 0);\n+ const unsigned long long __p = 1 + ((__w - 1)/ 32);\n+ uint_least32_t __tmpArr[(__n / 2) * __p];\n+ __q.generate(__tmpArr + 0, __tmpArr + ((__n / 2) *__p));\n+ for (unsigned long long __k = 0; __k < (__n/2); ++__k)\n+ {\n+ unsigned long long __precalc = 0;\n+ for (unsigned long long __j = 0; __j < __p; ++__j)\n+ {\n+\tunsigned long long __multiplicand = (1ull << (32 * __j));\n+\t__precalc += (__tmpArr[__k*__p + __j] * __multiplicand) & max();\n+ }\n+ _M_k[__k] = __precalc;\n+ }\n+ std::fill(_M_x.begin(), _M_x.end(), 0);\n+ std::fill(_M_y.begin(), _M_y.end(), 0);\n+ _M_i = __n - 1;\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ void\n+ philox_engine<_UIntType,\n+\t__w, __n, __r, __consts...>::discard(unsigned long long __z)\n+ {\n+ for (unsigned long long __j = 0; __j < __z; ++__j)\n+ _M_transition();\n+ }\n+\n+ template<class _UIntType,\n+\tsize_t __w, size_t __n,\n+\tsize_t __r, _UIntType... __consts>\n+ _UIntType\n+ philox_engine<_UIntType, __w, __n, __r, __consts...>::operator()()\n+ {\n+ _M_transition();\n+ return _M_y[_M_i];\n+ }\n+\n+#endif\n \n template<typename _IntType, typename _CharT, typename _Traits>\n std::basic_ostream<_CharT, _Traits>&\ndiff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def\nindex 65cd6ab80b8b..998c680fd345 100644\n--- a/libstdc++-v3/include/bits/version.def\n+++ b/libstdc++-v3/include/bits/version.def\n@@ -2125,6 +2125,15 @@ ftms = {\n };\n };\n \n+ftms = {\n+ name = philox_engine;\n+ values = {\n+ v = 202406;\n+ cxxmin = 26;\n+ extra_cond = \"__SIZEOF_INT128__\";\n+ };\n+};\n+\n // Standard test specifications.\n stds[97] = \">= 199711L\";\n stds[03] = \">= 199711L\";\ndiff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h\nindex af50ce4b362f..8cfd453c6a58 100644\n--- a/libstdc++-v3/include/bits/version.h\n+++ b/libstdc++-v3/include/bits/version.h\n@@ -2382,4 +2382,14 @@\n #endif /* !defined(__cpp_lib_constexpr_exceptions) && defined(__glibcxx_want_constexpr_exceptions) */\n #undef __glibcxx_want_constexpr_exceptions\n \n+#if !defined(__cpp_lib_philox_engine)\n+# if (__cplusplus > 202302L) && (__SIZEOF_INT128__)\n+# define __glibcxx_philox_engine 202406L\n+# if defined(__glibcxx_want_all) || defined(__glibcxx_want_philox_engine)\n+# define __cpp_lib_philox_engine 202406L\n+# endif\n+# endif\n+#endif /* !defined(__cpp_lib_philox_engine) && defined(__glibcxx_want_philox_engine) */\n+#undef __glibcxx_want_philox_engine\n+\n #undef __glibcxx_want_all\ndiff --git a/libstdc++-v3/include/std/random b/libstdc++-v3/include/std/random\nindex 0e058a04bd9a..8a02ade4b75e 100644\n--- a/libstdc++-v3/include/std/random\n+++ b/libstdc++-v3/include/std/random\n@@ -39,6 +39,9 @@\n # include <bits/c++0x_warning.h>\n #else\n \n+#define __glibcxx_want_philox_engine\n+#include <bits/version.h>\n+\n #include <cmath>\n #include <cstdint> // For uint_fast32_t, uint_fast64_t, uint_least32_t\n #include <cstdlib>\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox4x32.cc b/libstdc++-v3/testsuite/26_numerics/random/philox4x32.cc\nnew file mode 100644\nindex 000000000000..d5a8ca078eff\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox4x32.cc\n@@ -0,0 +1,23 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+#include <testsuite_hooks.h>\n+\n+void\n+test01()\n+{\n+ std::philox4x32 a;\n+ a.discard(9999);\n+\n+ VERIFY( a() == 1955073260 );\n+}\n+\n+int main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox4x64.cc b/libstdc++-v3/testsuite/26_numerics/random/philox4x64.cc\nnew file mode 100644\nindex 000000000000..131f094cb287\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox4x64.cc\n@@ -0,0 +1,23 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+#include <testsuite_hooks.h>\n+\n+void\n+test01()\n+{\n+ std::philox4x64 a;\n+ a.discard(9999);\n+\n+ VERIFY( a() == 3409172418970261260 );\n+}\n+\n+int main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/119794.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/119794.cc\nnew file mode 100644\nindex 000000000000..c3a5a0eb7545\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/119794.cc\n@@ -0,0 +1,39 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+#include <random>\n+#include <testsuite_hooks.h>\n+\n+int f(int x)\n+{\n+ std::seed_seq sq(&x, &x + 1);\n+ auto rnd = std::philox4x32(sq);\n+ return std::uniform_int_distribution<int>()(rnd);\n+}\n+\n+int g(int x)\n+{\n+ std::seed_seq sq(&x, &x + 1);\n+ auto rnd = std::philox4x32();\n+ rnd.seed(sq);\n+ return std::uniform_int_distribution<int>()(rnd);\n+}\n+\n+void test01()\n+{\n+ const int f1 = f(0);\n+ const int f2 = f(0);\n+\n+ const int g1 = g(0);\n+ const int g2 = g(0);\n+\n+ VERIFY( f1 == f2 );\n+ VERIFY( g1 == g2 );\n+ VERIFY( f1 == g1 );\n+}\n+\n+int main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/copy.cc\nnew file mode 100644\nindex 000000000000..4f61928a1575\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/copy.cc\n@@ -0,0 +1,25 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+\n+void\n+test01()\n+{\n+\n+ std::philox_engine<std::uint_fast32_t, 32, 4, 10, 0xCD9E8D57,\n+\t0x9E3779B9, 0xD2511F53, 0xBB67AE85> e(1ul);\n+\n+ const auto f(e);\n+ auto g(f);\n+ g = g; // Suppress unused warning\n+}\n+\n+int main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/default.cc\nnew file mode 100644\nindex 000000000000..9f9ae94db0f3\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/default.cc\n@@ -0,0 +1,27 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+#include <testsuite_hooks.h>\n+\n+void\n+test01()\n+{\n+ std::philox_engine<std::uint_fast32_t,\n+\t\t 32, 4, 10, 0xCD9E8D57,\n+\t\t 0x9E3779B9, 0xD2511F53,\n+\t\t 0xBB67AE85> philox4x32nullkey(0);\n+\n+ VERIFY( philox4x32nullkey.min() == 0 );\n+ VERIFY( philox4x32nullkey.max() == (1ul << 31 | (1ul << 31) - 1) );\n+ VERIFY( philox4x32nullkey() == 0x6627e8d5ul );\n+}\n+\n+int main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed.cc\nnew file mode 100644\nindex 000000000000..5cb914f4b45c\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed.cc\n@@ -0,0 +1,20 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+#include <random>\n+\n+void\n+test01()\n+{\n+ unsigned long seed = 2;\n+ std::philox_engine<std::uint_fast32_t,\n+\t\t 32, 4, 10, 0xCD9E8D57,\n+\t\t 0x9E3779B9, 0xD2511F53,\n+\t\t 0xBB67AE85> philox4x32seeded(seed);\n+}\n+\n+int main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed_seq.cc\nnew file mode 100644\nindex 000000000000..7d9e3e6540d2\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/cons/seed_seq.cc\n@@ -0,0 +1,24 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+\n+void\n+test01()\n+{\n+ std::seed_seq sseq{ 1, 2, 3, 4 };\n+ std::philox_engine<std::uint_fast32_t,\n+\t\t 32, 4, 10, 0xCD9E8D57,\n+\t\t 0x9E3779B9, 0xD2511F53,\n+\t\t 0xBB67AE85> philox4x32sseq(sseq);\n+}\n+\n+int\n+main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/equal.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/equal.cc\nnew file mode 100644\nindex 000000000000..4f62bfbbd88e\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/equal.cc\n@@ -0,0 +1,30 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+#include <testsuite_hooks.h>\n+\n+void\n+test01()\n+{\n+ std::philox_engine<std::uint_fast32_t,\n+\t\t 32, 4, 10, 0xCD9E8D57,\n+\t\t 0x9E3779B9, 0xD2511F53,\n+\t\t 0xBB67AE85> x, y;\n+\n+ VERIFY ( x == y);\n+ x.discard(100);\n+ y.discard(100);\n+\n+ VERIFY (x == y);\n+}\n+\n+int\n+main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/inequal.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/inequal.cc\nnew file mode 100644\nindex 000000000000..86d757db9040\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/inequal.cc\n@@ -0,0 +1,30 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+#include <testsuite_hooks.h>\n+\n+void\n+test01()\n+{\n+ std::philox_engine<std::uint_fast32_t,\n+\t\t 32, 4, 10, 0xCD9E8D57,\n+\t\t 0x9E3779B9, 0xD2511F53,\n+\t\t 0xBB67AE85> x, y;\n+\n+ VERIFY ( !(x != y) );\n+ x.discard(100);\n+ y.discard(100);\n+\n+ VERIFY ( !(x != y) );\n+}\n+\n+int\n+main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/serialize.cc\nnew file mode 100644\nindex 000000000000..bec4b1725127\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/operators/serialize.cc\n@@ -0,0 +1,49 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <sstream>\n+#include <random>\n+#include <testsuite_hooks.h>\n+#include <iostream>\n+\n+void\n+test01()\n+{\n+ std::stringstream str;\n+ std::philox_engine<std::uint_fast32_t,\n+\t\t 32, 4, 10, 0xCD9E8D57,\n+\t\t 0x9E3779B9, 0xD2511F53,\n+\t\t 0xBB67AE85> x, y;\n+\n+ x();\n+ str << x;\n+\n+ VERIFY ( !(x == y) );\n+ str >> y;\n+ VERIFY ( x == y );\n+ for (unsigned long i = 0; i < 100; ++i)\n+ {\n+ VERIFY (x() == y());\n+ }\n+ str.clear();\n+ str << y;\n+ x();\n+ x();\n+ x();\n+ str >> x;\n+ VERIFY ( x == y );\n+ for (unsigned long i = 0; i < 1000; ++i)\n+ {\n+ VERIFY (x() == y());\n+ }\n+}\n+\n+int\n+main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constants.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constants.cc\nnew file mode 100644\nindex 000000000000..c242056e0a4b\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constants.cc\n@@ -0,0 +1,26 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+\n+void test01()\n+{\n+ std::philox4x32 philox;\n+ const void* p = &philox.word_size;\n+ p = &philox.word_count;\n+ p = &philox.round_count;\n+ p = &philox.multipliers;\n+ p = &philox.round_consts;\n+ p = &philox.default_seed;\n+ p = p; // Suppress unused warning.\n+}\n+\n+int\n+main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_data.cc\nnew file mode 100644\nindex 000000000000..5be0108c88cd\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_data.cc\n@@ -0,0 +1,50 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+#include <testsuite_common_types.h>\n+\n+namespace __gnu_test\n+{\n+ struct constexpr_member_data\n+ {\n+ template<typename _Ttesttype>\n+ void\n+ operator()()\n+ {\n+\tstruct _Concept\n+\t{\n+\t void __constraint()\n+\t {\n+\t constexpr auto v1 __attribute__((unused))\n+\t\t= _Ttesttype::word_size;\n+\t constexpr auto v2 __attribute__((unused))\n+\t\t= _Ttesttype::word_count;\n+\t constexpr auto v3 __attribute__((unused))\n+\t\t= _Ttesttype::round_count;\n+\t constexpr auto v4 __attribute__((unused))\n+\t\t= _Ttesttype::multipliers;\n+\t constexpr auto v5 __attribute__((unused))\n+\t\t= _Ttesttype::round_consts;\n+\t constexpr auto v6 __attribute__((unused))\n+\t\t= _Ttesttype::default_seed;\n+\t }\n+\t};\n+\n+\t_Concept c;\n+\tc.__constraint();\n+ }\n+ };\n+};\n+\n+int\n+main()\n+{\n+ __gnu_test::constexpr_member_data test;\n+ typedef std::philox4x32 type;\n+ test.operator()<type>();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_functions.cc\nnew file mode 100644\nindex 000000000000..eb61d15568aa\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/constexpr_functions.cc\n@@ -0,0 +1,41 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+#include <random>\n+#include <testsuite_common_types.h>\n+\n+namespace __gnu_test\n+{\n+ struct constexpr_member_functions\n+ {\n+ template<typename _Ttesttype>\n+ void\n+ operator()()\n+ {\n+\tstruct _Concept\n+\t{\n+\t void __constraint()\n+\t {\n+\t constexpr auto v1 __attribute__((unused))\n+\t\t= _Ttesttype::min();\n+\t constexpr auto v2 __attribute__((unused))\n+\t\t= _Ttesttype::max();\n+\t }\n+\t};\n+\t_Concept c;\n+\tc.__constraint();\n+ }\n+ };\n+}\n+\n+int\n+main()\n+{\n+ __gnu_test::constexpr_member_functions test;\n+ typedef std::philox4x32 type;\n+ test.operator()<type>();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/typedefs.cc b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/typedefs.cc\nnew file mode 100644\nindex 000000000000..b368ee741069\n--- /dev/null\n+++ b/libstdc++-v3/testsuite/26_numerics/random/philox_engine/requirements/typedefs.cc\n@@ -0,0 +1,26 @@\n+// { dg-do run { target c++26 } }\n+// { dg-require-cstdint \"\" }\n+\n+// 29.5.4 Random Number Engine Class Templates\n+// 29.5.4.5 Class Template philox_engine\n+\n+\n+#include <random>\n+\n+void\n+test01()\n+{\n+ typedef std::philox_engine<std::uint_fast32_t,\n+\t\t 32, 4, 10, 0xCD9E8D57,\n+\t\t 0x9E3779B9, 0xD2511F53,\n+\t\t 0xBB67AE85> testType;\n+\n+ typedef testType::result_type result_type;\n+}\n+\n+int\n+main()\n+{\n+ test01();\n+ return 0;\n+}\ndiff --git a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc\nindex 0afba654152c..13a0b8947b05 100644\n--- a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc\n+++ b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc\n@@ -10,6 +10,6 @@ std::__detail::_Adaptor<std::mt19937, unsigned long> aurng(urng);\n auto x = std::generate_canonical<std::size_t,\n \t\t\tstd::numeric_limits<std::size_t>::digits>(urng);\n \n-// { dg-error \"static assertion failed: template argument must be a floating point type\" \"\" { target *-*-* } 270 }\n+// { dg-error \"static assertion failed: template argument must be a floating point type\" \"\" { target *-*-* } 271 }\n \n-// { dg-error \"static assertion failed: template argument must be a floating point type\" \"\" { target *-*-* } 3357 }\n+// { dg-error \"static assertion failed: template argument must be a floating point type\" \"\" { target *-*-* } 3548 }\n", "prefixes": [ "v1", "1/2" ] }