* decl.c (grok_op_properties): Add an extra check of argtypes.

From-SVN: r33524
This commit is contained in:
Cosmin Truta 2000-04-29 01:10:24 +03:00 committed by Jason Merrill
parent 62014cb327
commit 34332678da
2 changed files with 19 additions and 14 deletions

View File

@ -1,3 +1,7 @@
2000-04-28 Cosmin Truta <cosmint@cs.ubbcluj.ro>
* decl.c (grok_op_properties): Add an extra check of argtypes.
2000-04-28 Jason Merrill <jason@casey.cygnus.com> 2000-04-28 Jason Merrill <jason@casey.cygnus.com>
* optimize.c (initialize_inlined_parameters): Call * optimize.c (initialize_inlined_parameters): Call

View File

@ -12361,20 +12361,21 @@ grok_op_properties (decl, virtualp, friendp)
cp_warning ("`%D' should return by value", decl); cp_warning ("`%D' should return by value", decl);
/* 13.4.0.8 */ /* 13.4.0.8 */
if (argtypes) for (; argtypes && argtypes != void_list_node;
for (; argtypes != void_list_node ; argtypes = TREE_CHAIN (argtypes)) argtypes = TREE_CHAIN (argtypes))
if (TREE_PURPOSE (argtypes)) if (TREE_PURPOSE (argtypes))
{ {
TREE_PURPOSE (argtypes) = NULL_TREE; TREE_PURPOSE (argtypes) = NULL_TREE;
if (name == ansi_opname[(int) POSTINCREMENT_EXPR] if (name == ansi_opname[(int) POSTINCREMENT_EXPR]
|| name == ansi_opname[(int) POSTDECREMENT_EXPR]) || name == ansi_opname[(int) POSTDECREMENT_EXPR])
{ {
if (pedantic) if (pedantic)
cp_pedwarn ("`%D' cannot have default arguments", decl); cp_pedwarn ("`%D' cannot have default arguments", decl);
} }
else else
cp_error ("`%D' cannot have default arguments", decl); cp_error ("`%D' cannot have default arguments", decl);
} }
} }
} }