FreeBSD/contrib/gcc/cp/name-lookup.c
/* Returns true iff CURRENT has declared itself to be an associated
   namespace of SCOPE via a strong using-directive (or transitive chain
   thereof).  Both are namespaces.  */
Returns true iff CURRENT has declared itself to be an associated
namespace of SCOPE via a strong using-directive (or transitive chain
thereof).  Both are namespaces.
Returns true iff CURRENT has declared itself to be an associated namespace of SCOPE via a strong using - directive ( or transitive chain thereof ) . Both are namespaces .
bool
is_associated_namespace (tree current, tree scope)
{
  tree seen = NULL_TREE;
  tree todo = NULL_TREE;
  tree t;
  while (1)
    {
      if (scope == current)
	return true;
      seen = tree_cons (scope, NULL_TREE, seen);
      for (t = DECL_NAMESPACE_ASSOCIATIONS (scope); t; t = TREE_CHAIN (t))
	if (!purpose_member (TREE_PURPOSE (t), seen))
	  todo = tree_cons (TREE_PURPOSE (t), NULL_TREE, todo);
      if (todo)
	{
	  scope = TREE_PURPOSE (todo);
	  todo = TREE_CHAIN (todo);
	}
      else
	return false;
    }
}
bool is_associated_namespace ( tree current , tree scope ) { tree seen = NULL_TREE ; tree todo = NULL_TREE ; tree t ; while ( 1 ) { if ( scope == current ) return true ; seen = tree_cons ( scope , NULL_TREE , seen ) ; for ( t = DECL_NAMESPACE_ASSOCIATIONS ( scope ) ; t ; t = TREE_CHAIN ( t ) ) if ( ! purpose_member ( TREE_PURPOSE ( t ) , seen ) ) todo = tree_cons ( TREE_PURPOSE ( t ) , NULL_TREE , todo ) ; if ( todo ) { scope = TREE_PURPOSE ( todo ) ; todo = TREE_CHAIN ( todo ) ; } else return false ; } }
Returns true iff CURRENT has declared itself to be an associated
namespace of SCOPE via a strong using-directive (or transitive chain
thereof).
Returns true iff CURRENT has declared itself to be an associated namespace of SCOPE via a strong using - directive ( or transitive chain thereof ) .