summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog13
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/cp/name-lookup.c12
-rw-r--r--gcc/cp/name-lookup.h3
-rw-r--r--gcc/cp/pt.c8
6 files changed, 24 insertions, 16 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bd711f3aac1..87e4598263b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,16 @@
+2005-11-21 Richard Henderson <rth@redhat.com>
+
+ * cp-objcp-common.h, name-lookup.c, name-lookup.h: Revert 11-18 patch.
+
+ * name-lookup.c (lookup_name): Remove prefer_type argument.
+ (lookup_name_prefer_type): New.
+ * decl.c (lookup_and_check_tag): Use them.
+ * pt.c (tsubst_friend_class): Likewise.
+ (lookup_template_class): Likewise.
+ (tsubst_copy_and_build): Likewise.
+ * name-lookup.h (lookup_name_prefer_type): New.
+ (lookup_name): Remove declaration.
+
2005-11-18 Mark Mitchell <mark@codesourcery.com>
PR c++/8355
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index bd7f4f7958c..4a4d400cd6f 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -151,7 +151,5 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
-#undef LANG_HOOKS_LOOKUP_NAME
-#define LANG_HOOKS_LOOKUP_NAME lookup_name_one
#endif /* GCC_CP_OBJCP_COMMON */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 55e26b97ff6..d87983c1cb9 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9293,7 +9293,7 @@ lookup_and_check_tag (enum tag_types tag_code, tree name,
{
/* First try ordinary name lookup, ignoring hidden class name
injected via friend declaration. */
- decl = lookup_name (name, 2);
+ decl = lookup_name_prefer_type (name, 2);
/* If that fails, the name will be placed in the smallest
non-class, non-function-prototype scope according to 3.3.1/5.
We may already have a hidden name declared as friend in this
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 382a8a3a3ea..49830c61979 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3998,18 +3998,16 @@ lookup_function_nonclass (tree name, tree args, bool block_p)
}
tree
-lookup_name (tree name, int prefer_type)
+lookup_name (tree name)
{
- return lookup_name_real (name, prefer_type, 0, /*block_p=*/true,
- 0, LOOKUP_COMPLAIN);
+ return lookup_name_real (name, 0, 0, /*block_p=*/true, 0, LOOKUP_COMPLAIN);
}
-/* Similar to `lookup_name' for the benefit of common code. */
-
tree
-lookup_name_one (tree name)
+lookup_name_prefer_type (tree name, int prefer_type)
{
- return lookup_name (name, 0);
+ return lookup_name_real (name, prefer_type, 0, /*block_p=*/true,
+ 0, LOOKUP_COMPLAIN);
}
/* Look up NAME for type used in elaborated name specifier in
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index 11c1feca562..5a1dc8e34f5 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -312,8 +312,7 @@ extern void pop_nested_namespace (tree);
extern void pushlevel_class (void);
extern void poplevel_class (void);
extern tree pushdecl_with_scope (tree, cxx_scope *, bool);
-extern tree lookup_name (tree, int);
-extern tree lookup_name_one (tree);
+extern tree lookup_name_prefer_type (tree, int);
extern tree lookup_name_real (tree, int, int, bool, int, int);
extern tree lookup_type_scope (tree, tag_scope);
extern tree namespace_binding (tree, tree);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3e495643fd6..4f13a7d073e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4352,7 +4352,7 @@ lookup_template_class (tree d1,
{
if (context)
push_decl_namespace (context);
- template = lookup_name (d1, /*prefer_type=*/0);
+ template = lookup_name (d1);
template = maybe_get_template_decl_from_type_decl (template);
if (context)
pop_decl_namespace ();
@@ -5384,7 +5384,7 @@ tsubst_friend_class (tree friend_tmpl, tree args)
}
/* First, we look for a class template. */
- tmpl = lookup_name (DECL_NAME (friend_tmpl), /*prefer_type=*/0);
+ tmpl = lookup_name (DECL_NAME (friend_tmpl));
/* But, if we don't find one, it might be because we're in a
situation like this:
@@ -5399,7 +5399,7 @@ tsubst_friend_class (tree friend_tmpl, tree args)
for `S<int>', not the TEMPLATE_DECL. */
if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl))
{
- tmpl = lookup_name (DECL_NAME (friend_tmpl), /*prefer_type=*/1);
+ tmpl = lookup_name_prefer_type (DECL_NAME (friend_tmpl), 1);
tmpl = maybe_get_template_decl_from_type_decl (tmpl);
}
@@ -8516,7 +8516,7 @@ tsubst_copy_and_build (tree t,
}
/* Look up the name. */
- decl = lookup_name (t, 0);
+ decl = lookup_name (t);
/* By convention, expressions use ERROR_MARK_NODE to indicate
failure, not NULL_TREE. */