)]}'
{
  "commit": "911438f9f4516f2c5c3fc4eaecc47571aef98d1d",
  "tree": "c9411f5939e9ea7ab24baaa576c8ab597c578b91",
  "parents": [
    "0f8f2de1836941fe0c64ebac47e9a17a9063be86"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Thu Nov 18 15:41:45 2021 -0500"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Sat Nov 20 07:36:47 2021 -0500"
  },
  "message": "gdbsupport: fix array-view compilation with c++11 \u0026\u0026 _GLIBCXX_DEBUG\n\nWhen building with -std\u003dc++11 and -D_GLIBCXX_DEBUG\u003d1, we get some errors\nlike:\n\n      CXX    unittests/array-view-selftests.o\n    In file included from /home/smarchi/src/binutils-gdb/gdb/utils.h:25,\n                     from /home/smarchi/src/binutils-gdb/gdb/defs.h:630,\n                     from /home/smarchi/src/binutils-gdb/gdb/unittests/array-view-selftests.c:20:\n    /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/array-view.h: In instantiation of constexpr gdb::array_view\u003cT\u003e gdb::array_view\u003cT\u003e::slice(gdb::array_view\u003cT\u003e::size_type, gdb::array_view\u003cT\u003e::size_type) const [with T \u003d unsigned char; gdb::array_view\u003cT\u003e::size_type \u003d long unsigned int:\n    /home/smarchi/src/binutils-gdb/gdb/unittests/array-view-selftests.c:532:29:   required from here\n    /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/array-view.h:192:3: error: body of constexpr function constexpr gdb::array_view\u003cT\u003e gdb::array_view\u003cT\u003e::slice(gdb::array_view\u003cT\u003e::size_type, gdb::array_view\u003cT\u003e::size_type) const [with T \u003d unsigned char; gdb::array_view\u003cT\u003e::size_type \u003d long unsigned int not a return-statement\n      192 |   }\n          |   ^\n\nThis is because constexpr functions in c++11 can only consist of a\nsingle return statement, so we can\u0027t have the gdb_assert in there.  Make\nthe gdb_assert presence conditional to the __cplusplus version, to\nenable it only for c++14 and later.\n\nChange-Id: I2ac33f7b4bd1765ddc3ac8d07445b16ac1f340f0\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6f7e45a979c23817c563c46b75c39e8880b48197",
      "old_mode": 33188,
      "old_path": "gdbsupport/array-view.h",
      "new_id": "edf66559e2d91800dcc31fd3cbecf15ca349b69e",
      "new_mode": 33188,
      "new_path": "gdbsupport/array-view.h"
    }
  ]
}
