The following code produces an ambiguous warning from -Weffc++
class a {
private:
a operator||(const a&);
};
[/Users/fca] g++ -Weffc++ -c effcpp01.cxx
effcpp01.cxx:3: warning: user-defined 'a a::operator||(const a&)' always
evaluates both arguments
The meaning is "effective c++ discourages you to override the || operator
because you most probably will implement it in an unoptimised way, evaluating
uselessly both arguments". However the warning as it stands talks about an
implementation that, in this case does not exist. A better warning should be
produced.
--
Summary: Ambiguous warning with -Weffc++
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: federico dot carminati at cern dot ch
GCC host triplet: Darwin 8.8.1 i386
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29348