llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Parse a namespace-name.

   namespace-name:
     original-namespace-name
     namespace-alias

   Returns the NAMESPACE_DECL for the namespace.  */
Parse a namespace-name.

Returns the NAMESPACE_DECL for the namespace.
Parse a namespace - name . Returns the NAMESPACE_DECL for the namespace .
static tree
cp_parser_namespace_name (cp_parser* parser)
{
  tree identifier;
  tree namespace_decl;
  identifier = cp_parser_identifier (parser);
  if (identifier == error_mark_node)
    return error_mark_node;
  namespace_decl = cp_parser_lookup_name (parser, identifier,
					  none_type,
					  false,
					  true,
					  true,
					  NULL);
  if (namespace_decl == error_mark_node
      || TREE_CODE (namespace_decl) != NAMESPACE_DECL)
    {
      if (!cp_parser_uncommitted_to_tentative_parse_p (parser))
	error ("%qD is not a namespace-name", identifier);
      cp_parser_error (parser, "expected namespace-name");
      namespace_decl = error_mark_node;
    }
  return namespace_decl;
}
static tree cp_parser_namespace_name ( cp_parser * parser ) { tree identifier ; tree namespace_decl ; identifier = cp_parser_identifier ( parser ) ; if ( identifier == error_mark_node ) return error_mark_node ; namespace_decl = cp_parser_lookup_name ( parser , identifier , none_type , false , true , true , NULL ) ; if ( namespace_decl == error_mark_node || TREE_CODE ( namespace_decl ) != NAMESPACE_DECL ) { if ( ! cp_parser_uncommitted_to_tentative_parse_p ( parser ) ) error ( " " , identifier ) ; cp_parser_error ( parser , " " ) ; namespace_decl = error_mark_node ; } return namespace_decl ; }
Parse a namespace-name.
Parse a namespace - name .
/* Get the name of the namespace.  */ /* Look up the identifier in the currently active scope.  Look only
     for namespaces, due to:

       [basic.lookup.udir]

       When looking up a namespace-name in a using-directive or alias
       definition, only namespace names are considered.

     And:

       [basic.lookup.qual]

       During the lookup of a name preceding the :: scope resolution
       operator, object, function, and enumerator names are ignored.

     (Note that cp_parser_class_or_namespace_name only calls this
     function if the token after the name is the scope resolution
     operator.)  */ /*is_template=*/ /*is_namespace=*/ /*check_dependency=*/ /*ambiguous_decls=*/ /* If it's not a namespace, issue an error.  */