This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/29348] Ambiguous warning with -Weffc++



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-10-05 04:31 -------
effcpp01.cxx:3: warning: user-defined 'a a::operator||(const a&)' always
evaluates both arguments

I don't see why this is ambiguous.  Because normally || is short ciruting in
that if the left hand side is true the other side is not evaluated.  And it is
has nothing to do with optimization but rather correct behavior.
so with user defined operator||, you have to evaluate both sides which is
different than the default behavior which then could cause different behavior.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29348


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]