Commit 316a2456 by Mark Mitchell Committed by Mark Mitchell

re PR c++/10218 (ICE in make_decl_rtl for invalid code)

	PR c++/10218
	* decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class
	definitions.

From-SVN: r64985
parent 5c033b9f
2003-03-28 Mark Mitchell <mark@codesourcery.com>
PR c++/10218
* decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class
definitions.
* decl2.c (generate_ctor_or_dtor_function): Tolerate a
non-existant ssdf_decls array.
(finish_file): Call generator_ctor_or_dtor_function when there are
......
......@@ -9132,6 +9132,8 @@ grokfndecl (tree ctype,
if (old_decl)
{
bool ok;
/* Since we've smashed OLD_DECL to its
DECL_TEMPLATE_RESULT, we must do the same to DECL. */
if (TREE_CODE (decl) == TEMPLATE_DECL)
......@@ -9140,10 +9142,14 @@ grokfndecl (tree ctype,
/* Attempt to merge the declarations. This can fail, in
the case of some invalid specialization declarations. */
push_scope (ctype);
if (!duplicate_decls (decl, old_decl))
error ("no `%#D' member function declared in class `%T'",
decl, ctype);
ok = duplicate_decls (decl, old_decl);
pop_scope (ctype);
if (!ok)
{
error ("no `%#D' member function declared in class `%T'",
decl, ctype);
return NULL_TREE;
}
return old_decl;
}
}
......
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