Bug 60513 - False positive "division by zero" warning in unreachable code
Summary: False positive "division by zero" warning in unreachable code
Status: RESOLVED DUPLICATE of bug 4210
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.8.2
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-13 01:48 UTC by xzfcpw+gcc
Modified: 2014-03-13 02:10 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xzfcpw+gcc 2014-03-13 01:48:59 UTC
$ 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)
          ^
Comment 1 Andrew Pinski 2014-03-13 02:10:05 UTC
Dup of bug 4210.

*** This bug has been marked as a duplicate of bug 4210 ***