aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-06-28 00:13:17 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-06-27 20:13:17 -0400
commitdcd08efc5f30e6109cd55358797cb90bdac1c72b (patch)
tree8840883f8d26af5281d68cb5290779d7f977230b
parent9da8a3ae97750a437a1197bdafdae642db7471fb (diff)
downloadgcc-dcd08efc5f30e6109cd55358797cb90bdac1c72b.zip
gcc-dcd08efc5f30e6109cd55358797cb90bdac1c72b.tar.gz
gcc-dcd08efc5f30e6109cd55358797cb90bdac1c72b.tar.bz2
error.c (dump_type_real): Handle TREE_LIST again.
* 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
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/decl.c13
-rw-r--r--gcc/cp/error.c5
-rw-r--r--gcc/cp/typeck.c9
4 files changed, 28 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d7eeea4..ff7df31 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 0a4d539..9f98840 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a79420e..544e66e 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -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;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index ead755d..9e41af3 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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)