* decl.c (grokfndecl): Fix my thinko.
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 14 Oct 1998 02:58:38 +0000 (02:58 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 14 Oct 1998 02:58:38 +0000 (22:58 -0400)
From-SVN: r23077

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

index 053fb4b6ae60dbc9c79f526e6f38f63e569ccf86..87e9762326711570085f7101758830dcea27c87d 100644 (file)
@@ -1,3 +1,7 @@
+1998-10-14  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (grokfndecl): Fix my thinko.
+
 1998-10-13  Jason Merrill  <jason@yorick.cygnus.com>
 
        * tinfo2.cc (fast_compare): Remove.
index 91569d07b27c728c4ed14f0f77220503d7632c40..90b2e53d5be5ea50b7b2d21356739c94b40d16cb 100644 (file)
@@ -8024,9 +8024,14 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
       t = no_linkage_check (TREE_TYPE (decl));
       if (t)
        {
-         if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t))
-             && DECL_LANGUAGE (decl) != lang_c)
-           cp_pedwarn ("non-local function `%#D' uses anonymous type", decl);
+         if (ANON_AGGRNAME_P (TYPE_IDENTIFIER (t)))
+           {
+             if (DECL_LANGUAGE (decl) == lang_c)
+               /* Allow this; it's pretty common in C.  */;
+             else
+               cp_pedwarn ("non-local function `%#D' uses anonymous type",
+                           decl);
+           }
          else
            cp_pedwarn ("non-local function `%#D' uses local type `%T'",
                        decl, t);