This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52299] GCC warns on compile time division by zero erroneously
- From: "joseph.h.garvin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 20 Feb 2012 17:56:20 +0000
- Subject: [Bug c++/52299] GCC warns on compile time division by zero erroneously
- Auto-submitted: auto-generated
- References: <bug-52299-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52299
--- Comment #7 from Joseph Garvin <joseph.h.garvin at gmail dot com> 2012-02-20 17:56:20 UTC ---
Sorry, I should have copy and pasted the whole file. I was trying to save
people's time by providing a condensed snippet ;p
(In reply to comment #6)
> This reproduces it:
>
> template<unsigned x>
> struct test {
> static const unsigned a_
> = x ? 10 / x : 10;
> };
>
> int i = test<0>::a_;
>
> but next time please just provide code to reproduce the problem instead of
> wasting three people's time (and however many more read the report and didn't
> comment)