)]}'
{
  "commit": "fcbedcae9b6f6df537ceb01f6f3378a7f5a99bb2",
  "tree": "dd47153a69cba6c01feb1f40b76e0cf5838fc97a",
  "parents": [
    "ab3781665da064985d66de0c895cc43588179cb6"
  ],
  "author": {
    "name": "Jonathan Wakely",
    "email": "jwakely@redhat.com",
    "time": "Tue Jul 08 10:48:21 2025 +0100"
  },
  "committer": {
    "name": "Jonathan Wakely",
    "email": "redi@gcc.gnu.org",
    "time": "Fri Jul 11 09:38:07 2025 +0100"
  },
  "message": "libstdc++: Fix __uninitialized_default for constexpr case [PR119754]\n\nWe should not use the std::fill optimization for trivial types during\nconstant evaluation, because we need to begin the lifetime of all\nobjects, even trivially default constructible ones.\n\nThis fixes a bug that Clang diagnosed:\n\ninclude/c++/16.0.0/bits/stl_algobase.h:925:11: note: assignment to object outside its lifetime is not allowed in a constant expression\n  925 |         *__first \u003d __val;\n      |         ~~~~~~~~~^~~~~~~\n\nI initially just added the #ifdef __cpp_lib_is_constant_evaluated check,\nbut that gave warnings with GCC because the function isn\u0027t constexpr\nuntil C++26. So then I tried checking __glibcxx_raw_memory_algorithms\nfor the value indicating constexpr uninitialized_value_construct, but\nthat macro depends on __cpp_constexpr \u003e\u003d 202406 and Clang 19 doesn\u0027t\nsupport constexpr placement new, so doesn\u0027t define it.\n\nSo I decided to just change __uninitialized_default to use\n_GLIBCXX20_CONSTEXPR which is consistent with __uninitialized_default_n\n(which needs to be constexpr because it\u0027s used by std::vector). We don\u0027t\ncurrently need to use __uninitialized_default in constexpr contexts for\nC++20 code, but we might find uses for it, so now it would be possible.\n\nlibstdc++-v3/ChangeLog:\n\n\tPR libstdc++/119754\n\t* include/bits/stl_uninitialized.h (__uninitialized_default):\n\tDo not use optimized implementation for constexpr case. Use\n\t_GLIBCXX20_CONSTEXPR instead of _GLIBCXX26_CONSTEXPR.\n\n(cherry picked from commit 82d2d12da93b5afbc3479e64d0aa0dcec5b42d8d)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "eed924ded0a080a3cfb765defcc8f7802ebb78e8",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/include/bits/stl_uninitialized.h",
      "new_id": "d90e6aaf302291a0e8455f164a8fc495149f265e",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/include/bits/stl_uninitialized.h"
    }
  ]
}
