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++/52299] GCC warns on compile time division by zero erroneously


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)


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