aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2003-03-10 17:04:09 -0500
committerJason Merrill <jason@gcc.gnu.org>2003-03-10 17:04:09 -0500
commit70f0e2883a4554c39445a4fd27e1490fcc828853 (patch)
treeb902cae44221110fcb4a1215a2361abfa9d26d5b /gcc/cp
parentf3d2c79d415d0382d008125c1a838273ac4f6ba6 (diff)
downloadgcc-70f0e2883a4554c39445a4fd27e1490fcc828853.zip
gcc-70f0e2883a4554c39445a4fd27e1490fcc828853.tar.gz
gcc-70f0e2883a4554c39445a4fd27e1490fcc828853.tar.bz2
re PR c++/9798 (Infinite recursion (segfault) in cp/decl.c:push_using_directive with recusive using directives)
PR c++/9798 * decl.c (push_using_directive): Push before recursing. From-SVN: r64133
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4037471..9f70757 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,6 +1,9 @@
2003-03-10 Jason Merrill <jason@redhat.com>
- PR c++/9868
+ PR c++/9798
+ * decl.c (push_using_directive): Push before recursing.
+
+ PR c++/9868, c++/9524
* call.c (resolve_scoped_fn_name): Handle the case of a function
pointer member.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b3e617f..eeae35a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4442,14 +4442,15 @@ push_using_directive (tree used)
if (purpose_member (used, ud) != NULL_TREE)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
- /* Recursively add all namespaces used. */
- for (iter = DECL_NAMESPACE_USING (used); iter; iter = TREE_CHAIN (iter))
- push_using_directive (TREE_PURPOSE (iter));
-
ancestor = namespace_ancestor (current_decl_namespace (), used);
ud = current_binding_level->using_directives;
ud = tree_cons (used, ancestor, ud);
current_binding_level->using_directives = ud;
+
+ /* Recursively add all namespaces used. */
+ for (iter = DECL_NAMESPACE_USING (used); iter; iter = TREE_CHAIN (iter))
+ push_using_directive (TREE_PURPOSE (iter));
+
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, ud);
}