decl.c (start_decl): Don't just complain about a mismatched scope, fix it.

* decl.c (start_decl): Don't just complain about a mismatched
	scope, fix it.

From-SVN: r16591
This commit is contained in:
Jason Merrill 1997-11-20 04:43:53 +00:00 committed by Jason Merrill
parent 5951f637bc
commit f2d773a2fd
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,8 @@
Wed Nov 19 18:24:14 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (start_decl): Don't just complain about a mismatched
scope, fix it.
* decl.c (make_implicit_typename): Handle case where t is not
actually from context.
* tree.c (get_type_decl): Lose identifier case.

View File

@ -6009,7 +6009,12 @@ start_decl (declarator, declspecs, initialized)
else
{
if (DECL_CONTEXT (field) != context)
cp_pedwarn ("ANSI C++ does not permit `%T::%D' to be defined as `%T::%D'", DECL_CONTEXT (field), DECL_NAME (decl), context, DECL_NAME (decl));
{
cp_pedwarn ("ANSI C++ does not permit `%T::%D' to be defined as `%T::%D'",
DECL_CONTEXT (field), DECL_NAME (decl),
context, DECL_NAME (decl));
DECL_CONTEXT (decl) = DECL_CONTEXT (field);
}
if (duplicate_decls (decl, field))
decl = field;
}