Commit 273a708f by Mark Mitchell Committed by Mark Mitchell

cp-tree.h (poplevel_class): Declare.

	* cp-tree.h (poplevel_class): Declare.
	* class.c (popclass): Use poplevel_class, not poplevel.
	* decl.c (poplevel_class): Don't make it static.  Don't return a
	value.
	(poplevel): Don't call poplevel_class; abort in a class
	binding level is seen.
	* semantics.c (finish_translation_unit): Use pop_everything.
	* parse.y (member_init): Allow errors.
	(pending_inline): Call finish_function.
	* parse.c: Regenerated.
	* Makefile.in (CONFLICTS): Adjust.

From-SVN: r29472
parent 7c39cdd4
1999-09-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (poplevel_class): Declare.
* class.c (popclass): Use poplevel_class, not poplevel.
* decl.c (poplevel_class): Don't make it static. Don't return a
value.
(poplevel): Don't call poplevel_class; abort in a class
binding level is seen.
* semantics.c (finish_translation_unit): Use pop_everything.
* parse.y (member_init): Allow errors.
(pending_inline): Call finish_function.
* parse.c: Regenerated.
* Makefile.in (CONFLICTS): Adjust.
1999-09-17 Gabriel Dos Reis <gdr@codesourcery.com>
* error.c: Reduce code duplication.
......
......@@ -213,7 +213,7 @@ parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'`
CONFLICTS = expect 30 shift/reduce conflicts and 42 reduce/reduce conflicts.
CONFLICTS = expect 31 shift/reduce conflicts and 42 reduce/reduce conflicts.
$(PARSE_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS)
......
......@@ -4573,7 +4573,7 @@ invalidate_class_lookup_cache ()
void
popclass ()
{
poplevel (1, 0, 0);
poplevel_class ();
/* Since poplevel_class does the popping of class decls nowadays,
this really only frees the obstack used for these decls. */
pop_class_decls ();
......
......@@ -3120,6 +3120,7 @@ extern void insert_block PROTO((tree));
extern void add_block_current_level PROTO((tree));
extern void set_block PROTO((tree));
extern void pushlevel_class PROTO((void));
extern void poplevel_class PROTO((void));
extern void print_binding_stack PROTO((void));
extern void print_binding_level PROTO((struct binding_level *));
extern void push_namespace PROTO((tree));
......
......@@ -158,7 +158,6 @@ static tree record_builtin_java_type PROTO((const char *, int));
static const char *tag_name PROTO((enum tag_types code));
static void find_class_binding_level PROTO((void));
static struct binding_level *innermost_nonclass_level PROTO((void));
static tree poplevel_class PROTO((void));
static void warn_about_implicit_typename_lookup PROTO((tree, tree));
static int walk_namespaces_r PROTO((tree, walk_namespaces_fn, void *));
static int walk_globals_r PROTO((tree, void *));
......@@ -1201,8 +1200,8 @@ poplevel (keep, reverse, functionbody)
int block_previously_created;
int leaving_for_scope;
if (current_binding_level->parm_flag == 2)
return poplevel_class ();
my_friendly_assert (current_binding_level->parm_flag != 2,
19990916);
my_friendly_assert (!current_binding_level->class_shadowed,
19990414);
......@@ -1576,7 +1575,7 @@ pushlevel_class ()
/* ...and a poplevel for class declarations. */
static tree
void
poplevel_class ()
{
register struct binding_level *level = class_binding_level;
......@@ -1652,8 +1651,6 @@ poplevel_class ()
#endif /* defined(DEBUG_CP_BINDING_LEVELS) */
pop_binding_level ();
return NULL_TREE;
}
/* We are entering the scope of a class. Clear IDENTIFIER_CLASS_VALUE
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -854,6 +854,7 @@ member_init:
| typename_sub LEFT_RIGHT
{ expand_member_init (current_class_ref, TYPE_MAIN_DECL ($1),
void_type_node); }
| error
;
identifier:
......@@ -2081,8 +2082,8 @@ pending_inline:
process_next_inline ($1);
}
| fn.defpen maybe_return_init error
{ free_after_compilation (current_function);
current_function = NULL;
{
finish_function (lineno, 2);
process_next_inline ($1); }
;
......
......@@ -1542,8 +1542,7 @@ finish_translation_unit ()
{
/* In case there were missing closebraces,
get us back to the global binding level. */
while (! toplevel_bindings_p ())
poplevel (0, 0, 0);
pop_everything ();
while (current_namespace != global_namespace)
pop_namespace ();
finish_file ();
......
......@@ -15,10 +15,10 @@ protected:
SimQuery::SimQuery():scaling(A) {}// ERROR - .*
SimQuery::~SimQuery() {}// ERROR -
SimQuery::~SimQuery() {}
int SimQuery::SetMeshFile(char name[])
{// ERROR -
{
mesh = new C;// ERROR - .*
return 0; // needed to avoid warning of reaching end of non-void fn
}
......@@ -15,5 +15,5 @@ struct B {
struct C {
// The error message below says it is within A::B::m()!
void n() {} // gets bogus error - XFAIL *-*-*
void n() {}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment