[Bug c++/79919] New: Warning specifiedsend of method instead of correct line
amacleod at redhat dot com
gcc-bugzilla@gcc.gnu.org
Mon Mar 6 15:47:00 GMT 2017
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.
More information about the Gcc-bugs
mailing list