+2020-01-09 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/93208
+ * config/abi/pre/gnu.ver: Add new exports.
+ * include/std/memory_resource (memory_resource::~memory_resource()):
+ Do not define inline.
+ (monotonic_buffer_resource::~monotonic_buffer_resource()): Likewise.
+ * src/c++17/memory_resource.cc (memory_resource::~memory_resource()):
+ Define.
+ (monotonic_buffer_resource::~monotonic_buffer_resource()): Define.
+ * testsuite/20_util/monotonic_buffer_resource/93208.cc: New test.
+
2020-01-09 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/92124
_ZNSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEC2EOS5_;
_ZNSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEC2EOS6_;
+ # key functions, vtables and rtti for memory resources
+ _ZNSt3pmr15memory_resourceD[0125]Ev;
+ _ZT[ISV]NSt3pmr15memory_resourceE;
+ _ZNSt3pmr25monotonic_buffer_resourceD[0125]Ev;
+ _ZT[ISV]NSt3pmr25monotonic_buffer_resourceE;
+
} GLIBCXX_3.4.27;
# Symbols in the support library (libsupc++) have their own tag.
public:
memory_resource() = default;
memory_resource(const memory_resource&) = default;
- virtual ~memory_resource() = default;
+ virtual ~memory_resource(); // key function
memory_resource& operator=(const memory_resource&) = default;
monotonic_buffer_resource(const monotonic_buffer_resource&) = delete;
- virtual ~monotonic_buffer_resource() { release(); }
+ virtual ~monotonic_buffer_resource(); // key function
monotonic_buffer_resource&
operator=(const monotonic_buffer_resource&) = delete;
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace pmr
{
+ // This was defined inline in 9.1 and 9.2 so code compiled by those
+ // versions will not use this symbol.
+ memory_resource::~memory_resource() = default;
+
namespace
{
class newdel_res_t final : public memory_resource
// Member functions for std::pmr::monotonic_buffer_resource
+ // This was defined inline in 9.1 and 9.2 so code compiled by those
+ // versions will not use this symbol.
+ monotonic_buffer_resource::~monotonic_buffer_resource() { release(); }
+
// Memory allocated by the upstream resource is managed in a linked list
// of _Chunk objects. A _Chunk object recording the size and alignment of
// the allocated block and a pointer to the previous chunk is placed
--- /dev/null
+// Copyright (C) 2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
+// { dg-final { scan-assembler-not "_ZT\[IS\]NSt3pmr15memory_resourceE" } }
+// { dg-final { scan-assembler-not "_ZT\[IS\]NSt3pmr25monotonic\[a-z_\]*E" } }
+
+#include <memory_resource>
+
+void* f(int n)
+{
+ std::pmr::monotonic_buffer_resource res;
+ return res.allocate(n);
+}