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++/56607] [4.8/4.9 regression] GCC fails to warn on division by zero


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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-16 19:35:48 UTC ---
Author: jakub
Date: Sat Mar 16 19:35:41 2013
New Revision: 196704

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196704
Log:
    PR c++/56607
    * typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
    pass op1 through maybe_constant_value first.

    * g++.dg/warn/Wdiv-by-zero-2.C: New test.
    * c-c++-common/pr56607.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/pr56607.c
    trunk/gcc/testsuite/g++.dg/warn/Wdiv-by-zero-2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


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