From f2d773a2fdf45e585ab7cfd81cdf5c081dc91c24 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 20 Nov 1997 04:43:53 +0000 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/decl.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f10aea4a7b4..b123b92966e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ Wed Nov 19 18:24:14 1997 Jason Merrill + * 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. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3aa8201200a..5cda56a1f76 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; }