https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80348
--- Comment #12 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Author: mpolacek Date: Sat Jun 24 10:59:00 2017 New Revision: 249624 URL: https://gcc.gnu.org/viewcvs?rev=249624&root=gcc&view=rev Log: PR sanitizer/80348 * typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL. Set ORIG_TYPE earlier and not only when shortening. * g++.dg/ubsan/div-by-zero-3.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/ubsan/div-by-zero-3.C Modified: branches/gcc-6-branch/gcc/cp/ChangeLog branches/gcc-6-branch/gcc/cp/typeck.c branches/gcc-6-branch/gcc/testsuite/ChangeLog