This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60513] New: False positive "division by zero" warning in unreachable code
- From: "xzfcpw+gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 13 Mar 2014 01:48:59 +0000
- Subject: [Bug c++/60513] New: False positive "division by zero" warning in unreachable code
- Auto-submitted: auto-generated
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)
^