aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-01-05 10:02:35 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2005-01-05 10:02:35 +0000
commit4514aa8c6728182bf47343a8acbcec44e326f78e (patch)
tree125c8a7510120f2b97f1db6304937bded22e622d /gcc/cp/name-lookup.c
parentc2b43d7ab2ebe17d1f68e1ba4aa99c7d5a1c06aa (diff)
downloadgcc-4514aa8c6728182bf47343a8acbcec44e326f78e.zip
gcc-4514aa8c6728182bf47343a8acbcec44e326f78e.tar.gz
gcc-4514aa8c6728182bf47343a8acbcec44e326f78e.tar.bz2
re PR c++/19030 (ice on tree check)
cp: PR c++/19030 * cp-tree.h (start_decl): Take pointer to pushed scope, not bool. * name-lookup.h (push_scope): Return pushed scope, not flag. * name-lookup.c (push_scope): Return scope that should be popped, not a flag. * decl.c (start_decl): Adjust. (grokfndecl): Adjust scope push and pop. * decl2.c (check_classfn): Likewise. * parser.c (cp_parser_condition, cp_parser_conversion_function_id, cp_parser_init_declarator, cp_parser_direct_declarator, cp_parser_class_specifier, cp_parser_class_head, cp_parser_lookup_name, cp_parser_constructor_declarator_p): Likewise. * pt.c (instantiate_class_template, resolve_typename_type): Likewise. testsuite: PR c++/19030 * g++.dg/parse/crash22.C: New From-SVN: r92946
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r--gcc/cp/name-lookup.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 7f1ba91..ac5ad91 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -1,5 +1,5 @@
/* Definitions for C++ name lookup routines.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -2214,16 +2214,14 @@ is_ancestor (tree root, tree child)
}
}
-/* Enter the class or namespace scope indicated by T suitable for
- name lookup. T can be arbitrary scope, not necessary nested inside
- the current scope. Returns TRUE iff pop_scope should be called
- later to exit this scope. */
+/* Enter the class or namespace scope indicated by T suitable for name
+ lookup. T can be arbitrary scope, not necessary nested inside the
+ current scope. Returns a non-null scope to pop iff pop_scope
+ should be called later to exit this scope. */
-bool
+tree
push_scope (tree t)
{
- bool pop = true;
-
if (TREE_CODE (t) == NAMESPACE_DECL)
push_decl_namespace (t);
else if (CLASS_TYPE_P (t))
@@ -2236,10 +2234,10 @@ push_scope (tree t)
need to re-enter the scope. Since we are not actually
pushing a new scope, our caller should not call
pop_scope. */
- pop = false;
+ t = NULL_TREE;
}
- return pop;
+ return t;
}
/* Leave scope pushed by push_scope. */