)]}'
{
  "commit": "ad820b0bb5f8342a8db2831d1f15c103583a3ba0",
  "tree": "2b6913f1e66803824a67f0fd3a31fd05719030be",
  "parents": [
    "e27771e5dcd8cf2cb757db6177a3485acd28b88f"
  ],
  "author": {
    "name": "Jonathan Wakely",
    "email": "jwakely@redhat.com",
    "time": "Thu Oct 14 13:27:03 2021 +0100"
  },
  "committer": {
    "name": "Jonathan Wakely",
    "email": "jwakely@redhat.com",
    "time": "Fri Oct 15 18:26:53 2021 +0100"
  },
  "message": "libstdc++: Add missing constexpr to std::variant (P2231R1)\n\nThis implements the changes in P2231R1 which make std::variant fully\nconstexpr in C++20.\n\nWe need to replace placement new with std::construct_at, but that isn\u0027t\ndefined for C++17. Use std::_Construct instead, which forwards to\nstd::construct_at in C++20 mode (since the related changes to make\nstd::optional fully constexpr, in r12-4389).\n\nWe also need to replace the untyped char buffer in _Uninitialized with a\nunion, which can be accessed in constexpr functions. But the union needs\nto have a non-trivial destructor if its variant type is non-trivial,\nwhich means that the _Variadic_union also needs a non-trivial\ndestructor. This adds a constrained partial specialization of\n_Variadic_union for the C++20-only case where a non-trivial destructor\nis needed.\n\nWe can\u0027t use concepts to constrain the specialization (or the primary\ntemplate\u0027s destructor) in C++17, so retain the untyped char buffer\nsolution for C++17 mode.\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/std/variant (__cpp_lib_variant): Update value for\n\tC++20.\n\t(__variant_cast, __variant_construct): Add constexpr for C++20.\n\t(__variant_construct_single, __construct_by_index) Likewise. Use\n\tstd::_Construct instead of placement new.\n\t(_Uninitialized\u003cT, false\u003e) [__cplusplus \u003e\u003d 202002]: Replace\n\tbuffer with a union and define a destructor.\n\t(_Variadic_union) [__cplusplus \u003e\u003d 202002]: Add a specialization\n\tfor non-trivial destruction.\n\t(_Variant_storage::__index_of): New helper variable template.\n\t(_Variant_storage::~_Variant_storage()): Add constexpr.\n\t(_Variant_storage::_M_reset()): Likewise.\n\t(_Copy_ctor_base, _Move_ctor_base): Likewise.\n\t(_Copy_assign_base, _Move_assign_base): Likewise.\n\t(variant, swap): Likewise.\n\t* include/std/version (__cpp_lib_variant): Update value for\n\tC++20.\n\t* testsuite/20_util/optional/version.cc: Check for exact value\n\tin C++17.\n\t* testsuite/20_util/variant/87619.cc: Increase timeout for\n\tC++20 mode.\n\t* testsuite/20_util/variant/constexpr.cc: New test.\n\t* testsuite/20_util/variant/version.cc: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f49094130ee0c31ca3773d1b0e76cc389893d993",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/include/std/variant",
      "new_id": "d18365fde22d4681a2cf04bb1ba15c7ff0d2771b",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/include/std/variant"
    },
    {
      "type": "modify",
      "old_id": "a395c05db2d36138a9b501a548d33e6b5aa73d97",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/include/std/version",
      "new_id": "0d7ae3bf857bfd82ac622638aeca98b5d520b6c1",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/include/std/version"
    },
    {
      "type": "modify",
      "old_id": "d8c9851f28f63eb67d69fef607dd42da74d06832",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/testsuite/20_util/optional/version.cc",
      "new_id": "c18ecb8d48d1b23684440e1b6da7a1a0a6a53d64",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/testsuite/20_util/optional/version.cc"
    },
    {
      "type": "modify",
      "old_id": "e83fa0306b611ba7e055df5be8e3fbd38be11240",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/testsuite/20_util/variant/87619.cc",
      "new_id": "c87851007f2caa00dba933983cd53cffe0c7804b",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/testsuite/20_util/variant/87619.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7af3d98fe5d5d6284f64f68c5ed8398629c842b4",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/testsuite/20_util/variant/constexpr.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "de04c5eb2944f731e8c3222ba09be9cf665d054b",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/testsuite/20_util/variant/version.cc"
    }
  ]
}
