llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Parse a mem-initializer-id.

   mem-initializer-id:
     :: [opt] nested-name-specifier [opt] class-name
     identifier

   Returns a TYPE indicating the class to be initializer for the first
   production.  Returns an IDENTIFIER_NODE indicating the data member
   to be initialized for the second production.  */
Parse a mem-initializer-id.

Returns a TYPE indicating the class to be initializer for the first
production.  Returns an IDENTIFIER_NODE indicating the data member
to be initialized for the second production.
Parse a mem - initializer - id . Returns a TYPE indicating the class to be initializer for the first production . Returns an IDENTIFIER_NODE indicating the data member to be initialized for the second production .
static tree
cp_parser_mem_initializer_id (cp_parser* parser)
{
  bool global_scope_p;
  bool nested_name_specifier_p;
  bool template_p = false;
  tree id;
  if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TYPENAME))
    {
      error ("keyword %<typename%> not allowed in this context (a qualified "
	     "member initializer is implicitly a type)");
      cp_lexer_consume_token (parser->lexer);
    }
  global_scope_p
    = (cp_parser_global_scope_opt (parser,
				   false)
       != NULL_TREE);
  nested_name_specifier_p
    = (cp_parser_nested_name_specifier_opt (parser,
					    true,
					    true,
					    true,
					    true)
       != NULL_TREE);
  if (nested_name_specifier_p)
    template_p = cp_parser_optional_template_keyword (parser);
  if (global_scope_p || nested_name_specifier_p)
    return cp_parser_class_name (parser,
				 true,
				 template_p,
				 none_type,
				 true,
				 false,
				 true);
  cp_parser_parse_tentatively (parser);
  id = cp_parser_class_name (parser,
			     true,
			     false,
			     none_type,
			     true,
			     false,
			     true);
  if (cp_parser_parse_definitely (parser))
    return id;
  return cp_parser_identifier (parser);
}
static tree cp_parser_mem_initializer_id ( cp_parser * parser ) { bool global_scope_p ; bool nested_name_specifier_p ; bool template_p = false ; tree id ; if ( cp_lexer_next_token_is_keyword ( parser -> lexer , RID_TYPENAME ) ) { error ( " " " " ) ; cp_lexer_consume_token ( parser -> lexer ) ; } global_scope_p = ( cp_parser_global_scope_opt ( parser , false ) != NULL_TREE ) ; nested_name_specifier_p = ( cp_parser_nested_name_specifier_opt ( parser , true , true , true , true ) != NULL_TREE ) ; if ( nested_name_specifier_p ) template_p = cp_parser_optional_template_keyword ( parser ) ; if ( global_scope_p || nested_name_specifier_p ) return cp_parser_class_name ( parser , true , template_p , none_type , true , false , true ) ; cp_parser_parse_tentatively ( parser ) ; id = cp_parser_class_name ( parser , true , false , none_type , true , false , true ) ; if ( cp_parser_parse_definitely ( parser ) ) return id ; return cp_parser_identifier ( parser ) ; }
Parse a mem-initializer-id.
Parse a mem - initializer - id .
/* `typename' is not allowed in this context ([temp.res]).  */ /* Look for the optional `::' operator.  */ /*current_scope_valid_p=*/ /* Look for the optional nested-name-specifier.  The simplest way to
     implement:

       [temp.res]

       The keyword `typename' is not permitted in a base-specifier or
       mem-initializer; in these contexts a qualified name that
       depends on a template-parameter is implicitly assumed to be a
       type name.

     is to assume that we have seen the `typename' keyword at this
     point.  */ /*typename_keyword_p=*/ /*check_dependency_p=*/ /*type_p=*/ /*is_declaration=*/ /* If there is a `::' operator or a nested-name-specifier, then we
     are definitely looking for a class-name.  */ /*typename_keyword_p=*/ /*template_keyword_p=*/ /*check_dependency_p=*/ /*class_head_p=*/ /*is_declaration=*/ /* Otherwise, we could also be looking for an ordinary identifier.  */ /* Try a class-name.  */ /*typename_keyword_p=*/ /*template_keyword_p=*/ /*check_dependency_p=*/ /*class_head_p=*/ /*is_declaration=*/ /* If we found one, we're done.  */ /* Otherwise, look for an ordinary identifier.  */