[gdb/build, c++20] Handle deprecated std::allocator::construct
authorTom de Vries <tdevries@suse.de>
Thu, 17 Aug 2023 08:41:34 +0000 (10:41 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 17 Aug 2023 08:41:34 +0000 (10:41 +0200)
commit6feae66da1d652a50c1759bae46128087f7dfab0
tree187e50cc00b6309df206cfd9d66bbb8e38d9adec
parent9246b7bd6dfeb273f9be7648acffddfe19f966ff
[gdb/build, c++20] Handle deprecated std::allocator::construct

When building gdb with -std=c++20, I run into:
...
gdbsupport/default-init-alloc.h:52:12: error: ‘construct’ has not been \
  declared in ‘class std::allocator<unsigned char>’
   52 |   using A::construct;
      |            ^~~~~~~~~
...

Indeed, std::allocator::construct has been deprecated in c++17 and removed in
c++20.

Fix this by using instead std::pmr::polymorphic_allocator for c++20.

Tested on x86_64-linux.
gdbsupport/default-init-alloc.h