Commit 25eb19ff by Jason Merrill

except.c (process_start_catch_block_old): Call start_decl_1 for catch parm.

	* except.c (process_start_catch_block_old): Call start_decl_1 for
	catch parm.
	* decl.c (start_decl_1): Avoid duplicate error.
	* init.c (expand_default_init): Only perform the initialization if
	it will do something.
	* parse.y (base_class): Check for invalid base class.

From-SVN: r21353
parent ca2b3251
1998-07-23 Jason Merrill <jason@yorick.cygnus.com> 1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
* except.c (process_start_catch_block_old): Call start_decl_1 for
catch parm.
* decl.c (start_decl_1): Avoid duplicate error.
* init.c (expand_default_init): Only perform the initialization if
it will do something.
1998-07-23 H.J. Lu (hjl@gnu.org)
* parse.y (base_class): Check for invalid base class.
1998-07-23 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (import_export_template): Fold in... * decl2.c (import_export_template): Fold in...
(import_export_class): ...to here. Handle dllimport/export. (import_export_class): ...to here. Handle dllimport/export.
......
...@@ -6617,6 +6617,7 @@ start_decl_1 (decl) ...@@ -6617,6 +6617,7 @@ start_decl_1 (decl)
cp_error ("variable `%#D' has initializer but incomplete type", cp_error ("variable `%#D' has initializer but incomplete type",
decl); decl);
initialized = 0; initialized = 0;
type = TREE_TYPE (decl) = error_mark_node;
} }
else if (TYPE_SIZE (complete_type (TREE_TYPE (type))) == NULL_TREE) else if (TYPE_SIZE (complete_type (TREE_TYPE (type))) == NULL_TREE)
{ {
...@@ -6639,8 +6640,7 @@ start_decl_1 (decl) ...@@ -6639,8 +6640,7 @@ start_decl_1 (decl)
decl); decl);
/* Change the type so that assemble_variable will give /* Change the type so that assemble_variable will give
DECL an rtl we can live with: (mem (const_int 0)). */ DECL an rtl we can live with: (mem (const_int 0)). */
TREE_TYPE (decl) = error_mark_node; type = TREE_TYPE (decl) = error_mark_node;
type = error_mark_node;
} }
else else
{ {
......
...@@ -699,7 +699,9 @@ process_start_catch_block_old (declspecs, declarator) ...@@ -699,7 +699,9 @@ process_start_catch_block_old (declspecs, declarator)
DECL_INITIAL (decl) = init; DECL_INITIAL (decl) = init;
decl = pushdecl (decl); decl = pushdecl (decl);
cp_finish_decl (decl, init, NULL_TREE, 0, LOOKUP_ONLYCONVERTING); start_decl_1 (decl);
cp_finish_decl (decl, DECL_INITIAL (decl),
NULL_TREE, 0, LOOKUP_ONLYCONVERTING);
} }
else else
{ {
......
...@@ -1200,6 +1200,7 @@ expand_default_init (binfo, true_exp, exp, init, alias_this, flags) ...@@ -1200,6 +1200,7 @@ expand_default_init (binfo, true_exp, exp, init, alias_this, flags)
rval = build_method_call (exp, ctor_identifier, rval = build_method_call (exp, ctor_identifier,
parms, binfo, flags); parms, binfo, flags);
if (TREE_SIDE_EFFECTS (rval))
expand_expr_stmt (rval); expand_expr_stmt (rval);
} }
......
...@@ -2237,7 +2237,14 @@ base_class_list: ...@@ -2237,7 +2237,14 @@ base_class_list:
base_class: base_class:
base_class.1 base_class.1
{ {
tree type = TREE_TYPE ($1); tree type;
if ($1 == NULL_TREE)
{
error ("invalid base class");
type = error_mark_node;
}
else
type = TREE_TYPE ($1);
if (! is_aggr_type (type, 1)) if (! is_aggr_type (type, 1))
$$ = NULL_TREE; $$ = NULL_TREE;
else if (current_aggr == signature_type_node else if (current_aggr == signature_type_node
...@@ -2262,7 +2269,14 @@ base_class: ...@@ -2262,7 +2269,14 @@ base_class:
} }
| base_class_access_list see_typename base_class.1 | base_class_access_list see_typename base_class.1
{ {
tree type = TREE_TYPE ($3); tree type;
if ($3 == NULL_TREE)
{
error ("invalid base class");
type = error_mark_node;
}
else
type = TREE_TYPE ($3);
if (current_aggr == signature_type_node) if (current_aggr == signature_type_node)
error ("access and source specifiers not allowed in signature"); error ("access and source specifiers not allowed in signature");
if (! is_aggr_type (type, 1)) if (! is_aggr_type (type, 1))
......
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