https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79919
Bug ID: 79919
Summary: Warning specifiedsend of method instead of correct
line
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: amacleod at redhat dot com
Target Milestone: ---
Just stumbled across as useful warning, but the line number didn't help since
it specified the end of the method instead of the line the error was actually
on.
Reduced to:
extern void foo ();
enum s { RS_INV, RS_I, RS_S };
class c {
enum s state;
int op2;
void dump ();
};
void c::dump ()
{
if (op2 && state == RS_I && state == RS_S)
foo();
}
produces:
./xg++ -B./ foo.c -O2 -c
foo.c: In member function ‘void c::dump()’:
foo.c:14:1: warning: ‘and’ of mutually exclusive equal-tests is always 0
}
^
This is from trunk as on Mar 3.