/* ... and a list of namespace yet to see. */
tree todo = NULL_TREE;
tree todo_maybe = NULL_TREE;
+ tree *todo_weak = &todo_maybe;
tree usings;
timevar_push (TV_NAME_LOOKUP);
/* Look through namespace aliases. */
ambiguous_decl (result, binding, flags);
/* Consider strong using directives always, and non-strong ones
- if we haven't found a binding yet. ??? Shouldn't we consider
- non-strong ones if the initial RESULT is non-NULL, but the
- binding in the given namespace is? */
+ if we haven't found a binding yet. */
for (usings = DECL_NAMESPACE_USING (scope); usings;
usings = TREE_CHAIN (usings))
/* If this was a real directive, and we have not seen it. */
&& !purpose_member (TREE_PURPOSE (usings), seen)
&& !purpose_member (TREE_PURPOSE (usings), todo))
todo = tree_cons (TREE_PURPOSE (usings), NULL_TREE, todo);
- else if ((!result->value && !result->type)
+ else if (!binding
&& !purpose_member (TREE_PURPOSE (usings), seen)
&& !purpose_member (TREE_PURPOSE (usings), todo)
&& !purpose_member (TREE_PURPOSE (usings), todo_maybe))
- todo_maybe = tree_cons (TREE_PURPOSE (usings), NULL_TREE,
- todo_maybe);
+ *todo_weak = tree_cons (TREE_PURPOSE (usings), NULL_TREE,
+ *todo_weak);
}
if (todo)
{
scope = TREE_PURPOSE (todo_maybe);
todo = TREE_CHAIN (todo_maybe);
todo_maybe = NULL_TREE;
+ todo_weak = &todo;
}
else
scope = NULL_TREE; /* If there never was a todo list. */