error.c (dump_type_real): Handle TREE_LIST again.
authorJason Merrill <jason@yorick.cygnus.com>
Mon, 28 Jun 1999 00:13:17 +0000 (00:13 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 28 Jun 1999 00:13:17 +0000 (20:13 -0400)
* error.c (dump_type_real): Handle TREE_LIST again.
* typeck.c (comp_target_parms): Don't complain about
converting from () to (...) if !flag_strict_prototype.
* decl.c (grokdeclarator): Update the names of all variants when
de-anonymizing.

From-SVN: r27792

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/typeck.c

index d7eeea4a2d710706eb362aaf75e59ddced6b7a00..ff7df31d9f4c2d4aa56e02cc68a4511aa8e3313e 100644 (file)
@@ -1,3 +1,13 @@
+1999-06-28  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * error.c (dump_type_real): Handle TREE_LIST again.
+
+       * typeck.c (comp_target_parms): Don't complain about 
+       converting from () to (...) if !flag_strict_prototype.
+
+       * decl.c (grokdeclarator): Update the names of all variants when
+       de-anonymizing.
+
 1999-06-21  Mark Mitchell  <mark@codesourcery.com>
 
        * init.c (expand_aggr_vbase_init): Rename to
index 0a4d5396bda59eb0d92c1a8f354f8fc0ddbb0788..9f98840aa9bd4fe8ab72f90514efb89ca673b45c 100644 (file)
@@ -11066,18 +11066,17 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
          && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
          && ANON_AGGRNAME_P (TYPE_IDENTIFIER (type)))
        {
+         tree oldname = TYPE_NAME (type);
+         tree t;
+
          /* FIXME: This is bogus; we should not be doing this for
                    cv-qualified types.  */
 
-         /* For anonymous structs that are cv-qualified, need to use
-             TYPE_MAIN_VARIANT so that name will mangle correctly. As
-             type not referenced after this block, don't bother
-             resetting type to original type, ie. TREE_TYPE (decl). */
-         type = TYPE_MAIN_VARIANT (type);
-
          /* Replace the anonymous name with the real name everywhere.  */
          lookup_tag_reverse (type, declarator);
-         TYPE_NAME (type) = decl;
+         for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
+           if (TYPE_NAME (t) == oldname)
+             TYPE_NAME (t) = decl;
 
          if (TYPE_LANG_SPECIFIC (type))
            TYPE_WAS_ANONYMOUS (type) = 1;
index a79420ec77882c76bdf32803a99ce78bab83007e..544e66e8e3b0813ec9346ea5095c45c91e50efbb 100644 (file)
@@ -211,6 +211,11 @@ dump_type_real (t, v, canonical_name)
       OB_PUTS ("{unknown type}");
       break;
 
+    case TREE_LIST:
+      /* A list of function parms.  */
+      dump_parameters (t, 0, canonical_name);
+      break;
+
     case IDENTIFIER_NODE:
       OB_PUTID (t);
       break;
index ead755d8371a66a185012512005602745e74514a..9e41af3f38d18aa3b07a45f8ec44650d3b59d3bc 100644 (file)
@@ -1357,8 +1357,13 @@ comp_target_parms (parms1, parms2, strict)
 
   if (t1 == 0 && t2 != 0)
     {
-      cp_pedwarn ("ANSI C++ prohibits conversion from `(%#T)' to `(...)'",
-                 parms2);
+      if (! flag_strict_prototype && t2 == void_list_node)
+       /* t1 might be the arglist of a function pointer in extern "C"
+          declared to take (), which we fudged to (...).  Don't make the
+          user pay for our mistake.  */;
+      else
+       cp_pedwarn ("ANSI C++ prohibits conversion from `%#T' to `(...)'",
+                   parms2);
       return self_promoting_args_p (t2);
     }
   if (t2 == 0)