aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-11-09 12:56:43 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-12-12 22:51:12 +0000
commitb8f7ff76d6f0b7fdffc314a19425423606b5e296 (patch)
treef19438f2a2a95503d4336e9c74de3912f6c896c4 /gcc/cp/name-lookup.c
parent0b52083ea2c2dd9897031fdc3802a68fd4aa45ef (diff)
downloadgcc-b8f7ff76d6f0b7fdffc314a19425423606b5e296.zip
gcc-b8f7ff76d6f0b7fdffc314a19425423606b5e296.tar.gz
gcc-b8f7ff76d6f0b7fdffc314a19425423606b5e296.tar.bz2
Replace gnu::unique_ptr with std::unique_ptr
Now that GCC is compiled as C++11 there is no need to keep the C++03 implementation of gnu::unique_ptr. This removes the unique-ptr.h header and replaces it with <memory> in system.h, and changes the INCLUDE_UNIQUE_PTR macro to INCLUDE_MEMORY. Uses of gnu::unique_ptr and gnu::move can be replaced with std::unique_ptr and std::move. There are no uses of unique_xmalloc_ptr or xmalloc_deleter in GCC. gcc/analyzer/ChangeLog: * engine.cc: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. gcc/c-family/ChangeLog: * known-headers.cc: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. * name-hint.h: Likewise. (class name_hint): Use std::unique_ptr instead of gnu::unique_ptr. gcc/c/ChangeLog: * c-decl.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. * c-parser.c: Likewise. gcc/cp/ChangeLog: * error.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. * lex.c: Likewise. * name-lookup.c: Likewise. (class namespace_limit_reached): Use std::unique_ptr instead of gnu::unique_ptr. (suggest_alternatives_for): Use std::move instead of gnu::move. (suggest_alternatives_in_other_namespaces): Likewise. * parser.c: Define INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR. gcc/ChangeLog: * Makefile.in: Remove unique-ptr-tests.o. * selftest-run-tests.c (selftest::run_tests): Remove unique_ptr_tests_cc_tests. * selftest.h (unique_ptr_tests_cc_tests): Remove. * system.h: Check INCLUDE_MEMORY instead of INCLUDE_UNIQUE_PTR and include <memory> instead of "unique-ptr.h". * unique-ptr-tests.cc: Removed. include/ChangeLog: * unique-ptr.h: Removed.
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r--gcc/cp/name-lookup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 229ba45..6b5e434 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -19,7 +19,7 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
-#define INCLUDE_UNIQUE_PTR
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "cp-tree.h"
@@ -6340,7 +6340,7 @@ class namespace_limit_reached : public deferred_diagnostic
{
public:
namespace_limit_reached (location_t loc, unsigned limit, tree name,
- gnu::unique_ptr<deferred_diagnostic> wrapped)
+ std::unique_ptr<deferred_diagnostic> wrapped)
: deferred_diagnostic (loc),
m_limit (limit), m_name (name),
m_wrapped (move (wrapped))
@@ -6360,7 +6360,7 @@ class namespace_limit_reached : public deferred_diagnostic
private:
unsigned m_limit;
tree m_name;
- gnu::unique_ptr<deferred_diagnostic> m_wrapped;
+ std::unique_ptr<deferred_diagnostic> m_wrapped;
};
/* Subclass of deferred_diagnostic, for use when issuing a single suggestion.
@@ -6604,7 +6604,7 @@ suggest_alternatives_for (location_t location, tree name,
if (!result)
result = suggest_alternatives_for_1 (location, name, suggest_misspellings);
- return ns_hints.maybe_decorate_with_limit (gnu::move (result));
+ return ns_hints.maybe_decorate_with_limit (std::move (result));
}
/* The second half of suggest_alternatives_for, for when no exact matches
@@ -6649,7 +6649,7 @@ suggest_alternatives_in_other_namespaces (location_t location, tree name)
name_hint result = ns_hints.convert_candidates_to_name_hint ();
- return ns_hints.maybe_decorate_with_limit (gnu::move (result));
+ return ns_hints.maybe_decorate_with_limit (std::move (result));
}
/* A well-known name within the C++ standard library, returned by