]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/9798 (Infinite recursion (segfault) in cp/decl.c:push_using_directive with...
authorJason Merrill <jason@redhat.com>
Mon, 10 Mar 2003 22:11:08 +0000 (17:11 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 10 Mar 2003 22:11:08 +0000 (17:11 -0500)
        PR c++/9798
        * decl.c (push_using_directive): Push before recursing.

From-SVN: r64135

gcc/cp/ChangeLog
gcc/cp/decl.c

index 6c0c6ef21c2c10d715771b676bbd1ea162895e5d..ea552bbe7cbd9149c598984c67e38a02b7965c1b 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-10  Jason Merrill  <jason@redhat.com>
+
+       PR c++/9798
+       * decl.c (push_using_directive): Push before recursing.
+
 2003-02-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/9602
index cbb87184eda3b48ccab4629f9fd8b65638b9e4ba..3e23c8aeeceebb072b45927f298dbcf90fdd6ba5 100644 (file)
@@ -4539,14 +4539,15 @@ push_using_directive (used)
   if (purpose_member (used, ud) != NULL_TREE)
     return 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));
+
   return ud;
 }