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++/60513] New: False positive "division by zero" warning in unreachable code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60513

            Bug ID: 60513
           Summary: False positive "division by zero" warning in
                    unreachable code
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xzfcpw+gcc at gmail dot com

$ cat 12.cpp
int main()
{
    constexpr int i = 0;
    int j = 20;
    if(i)
        if(j % i)
            /* ... */;
}

$ g++ -std=c++11 12.cpp
12.cpp: In function âint main()â:
12.cpp:6:10: warning: division by zero [-Wdiv-by-zero]
   if(j % i)
          ^

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