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++/79919] New: Warning specifiedsend of method instead of correct line


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.

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