)]}'
{
  "commit": "6f04937e1d7db190ca96ec08d8aeb25f0ec6e994",
  "tree": "de5d58cda64d3d65ef78eed7bc3216bcdaa0f2e2",
  "parents": [
    "ad59259604f008e20490f9c82cf287d5a601a66c"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Fri Jan 10 08:40:11 2025 +0100"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Fri Jan 10 08:40:11 2025 +0100"
  },
  "message": "[gdb/build, c++20] Fix build with gcc 10\n\nWith gcc 10 and -std\u003dc++20, we run into the same problem as reported in commit\n6feae66da1d (\"[gdb/build, c++20] Handle deprecated std::allocator::construct\").\n\nThe problem was fixed using:\n...\n-template\u003ctypename T, typename A \u003d std::allocator\u003cT\u003e\u003e\n+template\u003ctypename T,\n+         typename A\n+#if __cplusplus \u003e\u003d 202002L\n+         \u003d std::pmr::polymorphic_allocator\u003cT\u003e\n+#else\n+         \u003d std::allocator\u003cT\u003e\n+#endif\n+        \u003e\n...\nbut that doesn\u0027t work for gcc 10, because it defines __cplusplus differently:\n...\n $ echo | g++-10 -E -dD -x c++ - -std\u003dc++20 2\u003e\u00261 | grep __cplusplus\n #define __cplusplus 201709L\n $ echo | g++-11 -E -dD -x c++ - -std\u003dc++20 2\u003e\u00261 | grep __cplusplus\n #define __cplusplus 202002L\n...\n\nFix this by using the library feature test macro\n__cpp_lib_polymorphic_allocator [1], which is undefined for c++17 and defined\nfor c++20:\n...\n $ echo | g++-10 -E -dD -x c++ - -include memory_resource -std\u003dc++17 2\u003e\u00261 \\\n   | grep __cpp_lib_polymorphic_allocator\n $ echo | g++-10 -E -dD -x c++ - -include memory_resource -std\u003dc++20 2\u003e\u00261 \\\n   | grep __cpp_lib_polymorphic_allocator\n #define __cpp_lib_polymorphic_allocator 201902L\n $\n...\n\nA similar problem exists for commit 3173529d7de (\"[gdb/guile, c++20] Work\naround Werror\u003dvolatile in libguile.h\").  Fix this by testing for 201709L\ninstead.\n\nTested on x86_64-linux, by building gdb with\n{gcc 10, clang 17.0.6} x {-std\u003dc++17, -std\u003dc++20}.\n\nPR build/32503\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d32503\n\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\n\n[1] https://en.cppreference.com/w/cpp/feature_test#cpp_lib_polymorphic_allocator\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8d83b8b808ab4920267103639b931bf708ba3678",
      "old_mode": 33188,
      "old_path": "gdb/guile/guile-internal.h",
      "new_id": "1057b83324593875d692978261e5f0420002743b",
      "new_mode": 33188,
      "new_path": "gdb/guile/guile-internal.h"
    },
    {
      "type": "modify",
      "old_id": "e84110f128a0414965f7675b95a4c5b07ef13412",
      "old_mode": 33188,
      "old_path": "gdbsupport/default-init-alloc.h",
      "new_id": "1cb1dcf8d818429bc151d1e07f1fd9ebc4e30834",
      "new_mode": 33188,
      "new_path": "gdbsupport/default-init-alloc.h"
    }
  ]
}
