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

federico dot carminati at cern dot ch gcc-bugzilla@gcc.gnu.org
Wed Oct 4 16:15:00 GMT 2006


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



More information about the Gcc-bugs mailing list