Commit 70f0e288 by Jason Merrill Committed by Jason Merrill

re PR c++/9798 (Infinite recursion (segfault) in cp/decl.c:push_using_directive…

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
parent f3d2c79d
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.
......
......@@ -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);
}
......
// PR c++/9798
namespace std { }
namespace STL { using namespace std; }
namespace std {
using namespace STL;
}
namespace STL {
struct A {
void B() { using namespace std; }
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment