summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-28 00:13:17 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-06-28 00:13:17 +0000
commit1717856ae12d13ae2407965ac044239e61026bd4 (patch)
tree8840883f8d26af5281d68cb5290779d7f977230b /gcc/cp
parent5ca0f2c2c1567124c5e21770e299af9e6b65d77d (diff)
downloadgcc-1717856ae12d13ae2407965ac044239e61026bd4.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27792 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-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 d7eeea4a2d7..ff7df31d9f4 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 0a4d5396bda..9f98840aa9b 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 a79420ec778..544e66e8e3b 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 ead755d8371..9e41af3f38d 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)