]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (start_decl): Don't just complain about a mismatched scope, fix it.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 20 Nov 1997 04:42:10 +0000 (04:42 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 20 Nov 1997 04:42:10 +0000 (23:42 -0500)
* decl.c (start_decl): Don't just complain about a mismatched
scope, fix it.

From-SVN: r16590

gcc/cp/ChangeLog
gcc/cp/decl.c

index 1350bbac668f9a0424f2e3d0e835c0e975700c33..765d843878b8809e32c34b41e168e2d33212c3fb 100644 (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.
index fc07dc7df6e7ceab3891eb35ab95cf3aec1156c8..35a9a4b0ba2d26392e60721c38377fc1d63a7704 100644 (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;
            }