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
This commit is contained in:
Jason Merrill 1999-06-28 00:13:17 +00:00 committed by Jason Merrill
parent 9da8a3ae97
commit dcd08efc5f
4 changed files with 28 additions and 9 deletions

View 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

View 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;

View 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;

View 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)