llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Check for a common situation where a type-name should be present,
   but is not, and issue a sensible error message.  Returns true if an
   invalid type-name was detected.

   The situation handled by this function are variable declarations of the
   form `ID a', where `ID' is an id-expression and `a' is a plain identifier.
   Usually, `ID' should name a type, but if we got here it means that it
   does not. We try to emit the best possible error message depending on
   how exactly the id-expression looks like.  */
Check for a common situation where a type-name should be present,
but is not, and issue a sensible error message.  Returns true if an
invalid type-name was detected.

The situation handled by this function are variable declarations of the
form `ID a', where `ID' is an id-expression and `a' is a plain identifier.
Usually, `ID' should name a type, but if we got here it means that it
does not. We try to emit the best possible error message depending on
how exactly the id-expression looks like.
Check for a common situation where a type - name should be present but is not and issue a sensible error message . Returns true if an invalid type - name was detected . The situation handled by this function are variable declarations of the form ` ID a ' where ` ID ' is an id - expression and ` a ' is a plain identifier . Usually ` ID ' should name a type but if we got here it means that it does not . We try to emit the best possible error message depending on how exactly the id - expression looks like .
static bool
cp_parser_parse_and_diagnose_invalid_type_name (cp_parser *parser)
{
  tree id;
  cp_parser_parse_tentatively (parser);
  id = cp_parser_id_expression (parser,
				false,
				true,
				NULL,
				true,
				false);
  if (!cp_lexer_next_token_is (parser->lexer, CPP_NAME)
      || (parser->scope && TYPE_P (parser->scope)
	  && dependent_type_p (parser->scope))
      || TREE_CODE (id) == TYPE_DECL)
    {
      cp_parser_abort_tentative_parse (parser);
      return false;
    }
  if (!cp_parser_parse_definitely (parser))
    return false;
  cp_parser_diagnose_invalid_type_name (parser, parser->scope, id);
  cp_parser_skip_to_end_of_block_or_statement (parser);
  return true;
}
static bool cp_parser_parse_and_diagnose_invalid_type_name ( cp_parser * parser ) { tree id ; cp_parser_parse_tentatively ( parser ) ; id = cp_parser_id_expression ( parser , false , true , NULL , true , false ) ; if ( ! cp_lexer_next_token_is ( parser -> lexer , CPP_NAME ) || ( parser -> scope && TYPE_P ( parser -> scope ) && dependent_type_p ( parser -> scope ) ) || TREE_CODE ( id ) == TYPE_DECL ) { cp_parser_abort_tentative_parse ( parser ) ; return false ; } if ( ! cp_parser_parse_definitely ( parser ) ) return false ; cp_parser_diagnose_invalid_type_name ( parser , parser -> scope , id ) ; cp_parser_skip_to_end_of_block_or_statement ( parser ) ; return true ; }
Check for a common situation where a type-name should be present,
but is not, and issue a sensible error message.
Check for a common situation where a type - name should be present but is not and issue a sensible error message .
/*template_keyword_p=*/ /*check_dependency_p=*/ /*template_p=*/ /*declarator_p=*/ /*optional_p=*/ /* After the id-expression, there should be a plain identifier,
     otherwise this is not a simple variable declaration. Also, if
     the scope is dependent, we cannot do much.  */ /* Emit a diagnostic for the invalid type.  */ /* Skip to the end of the declaration; there's no point in
     trying to process it.  */