* decl.c (grokfndecl): Fix my thinko.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Oct 1998 02:58:38 +0000 (02:58 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Oct 1998 02:58:38 +0000 (02:58 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23077 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 053fb4b..87e9762 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 91569d0..90b2e53 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);