diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7f96445a207..42c63fca7a9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2000-04-28 Cosmin Truta + + * decl.c (grok_op_properties): Add an extra check of argtypes. + 2000-04-28 Jason Merrill * optimize.c (initialize_inlined_parameters): Call diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 78c41671957..deb9e8f3077 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12361,20 +12361,21 @@ grok_op_properties (decl, virtualp, friendp) cp_warning ("`%D' should return by value", decl); /* 13.4.0.8 */ - if (argtypes) - for (; argtypes != void_list_node ; argtypes = TREE_CHAIN (argtypes)) - if (TREE_PURPOSE (argtypes)) - { - TREE_PURPOSE (argtypes) = NULL_TREE; - if (name == ansi_opname[(int) POSTINCREMENT_EXPR] - || name == ansi_opname[(int) POSTDECREMENT_EXPR]) - { - if (pedantic) - cp_pedwarn ("`%D' cannot have default arguments", decl); - } - else - cp_error ("`%D' cannot have default arguments", decl); - } + for (; argtypes && argtypes != void_list_node; + argtypes = TREE_CHAIN (argtypes)) + if (TREE_PURPOSE (argtypes)) + { + TREE_PURPOSE (argtypes) = NULL_TREE; + if (name == ansi_opname[(int) POSTINCREMENT_EXPR] + || name == ansi_opname[(int) POSTDECREMENT_EXPR]) + { + if (pedantic) + cp_pedwarn ("`%D' cannot have default arguments", decl); + } + else + cp_error ("`%D' cannot have default arguments", decl); + } + } }