/* YACC parser for C++ syntax.
- Copyright (C) 1988, 89, 93-98, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1989, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GNU CC.
extdefs:
{ $<ttype>$ = NULL_TREE; }
lang_extdef
- { $<ttype>$ = NULL_TREE; }
+ { $<ttype>$ = NULL_TREE; ggc_collect (); }
| extdefs lang_extdef
- { $<ttype>$ = NULL_TREE; }
+ { $<ttype>$ = NULL_TREE; ggc_collect (); }
;
extdefs_opt:
fn.def1:
typed_declspecs declarator
- { if (!begin_function_definition ($1.t, $2))
+ { check_for_new_type ("return type", $1);
+ if (!begin_function_definition ($1.t, $2))
YYERROR1; }
| declmods notype_declarator
{ if (!begin_function_definition ($1.t, $2))
/* struct B: public A; is not accepted by the standard grammar. */
if (CLASS_TYPE_P ($$.t)
&& TYPE_BINFO_BASETYPES ($$.t)
- && !TYPE_SIZE ($$.t)
+ && !COMPLETE_TYPE_P ($$.t)
&& ! TYPE_BEING_DEFINED ($$.t))
cp_error ("base clause without member specification for `%#T'",
$$.t);
typename_sub0:
typename_sub1 identifier %prec EMPTY
{
- if (TREE_CODE_CLASS (TREE_CODE ($1)) == 't')
+ if (TYPE_P ($1))
$$ = make_typename_type ($1, $2, /*complain=*/1);
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", $2);
}
| typename_sub1 typename_sub2
{
- if (TREE_CODE_CLASS (TREE_CODE ($1)) == 't')
+ if (TYPE_P ($1))
$$ = make_typename_type ($1, $2, /*complain=*/1);
else if (TREE_CODE ($2) == IDENTIFIER_NODE)
cp_error ("`%T' is not a class or namespace", $2);