PR c++/5719
* decl.c (grok_op_properties): Assignment ops don't have to return
by value. operator% should.
testsuite:
* g++.dg/warn/effc1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52888
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-04-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/5719
+ * decl.c (grok_op_properties): Assignment ops don't have to return
+ by value. operator% should.
+
2002-04-28 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
PR c/6343
/* Effective C++ rule 23. */
if (warn_ecpp
&& arity == 2
+ && !DECL_ASSIGNMENT_OPERATOR_P (decl)
&& (operator_code == PLUS_EXPR
|| operator_code == MINUS_EXPR
|| operator_code == TRUNC_DIV_EXPR
- || operator_code == MULT_EXPR)
+ || operator_code == MULT_EXPR
+ || operator_code == TRUNC_MOD_EXPR)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == REFERENCE_TYPE)
warning ("`%D' should return by value", decl);
+2002-04-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/warn/effc1.C: New test.
+
2002-04-29 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/if-cexp.c: Add a test.
--- /dev/null
+// { dg-options -Weffc++ }
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 Apr 2002 <nathan@codesourcery.com>
+
+// Bug 5719
+
+class A
+{
+ public:
+ A & operator+=( int );
+ A & operator+( int ); // { dg-warning "`A& A::operator+(int)' should return by value" "" }
+ A operator+=( float );
+ A operator+( float );
+};