https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112701
Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-11-27
Ever confirmed|0 |1
CC| |lhyatt at gcc dot gnu.org
--- Comment #4 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
Here is the fix. Not sure if it needs to wait for GCC 15 by now, but I can
submit it with the testcase.
diff --git a/libcpp/expr.cc b/libcpp/expr.cc
index 825d2c2369d..4f4a9722ac7 100644
--- a/libcpp/expr.cc
+++ b/libcpp/expr.cc
@@ -2216,6 +2216,7 @@ num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs,
enum cpp_ttype op,
if (!pfile->state.skip_eval)
cpp_error_with_line (pfile, CPP_DL_ERROR, location, 0,
"division by zero in #if");
+ lhs.unsignedp = unsignedp;
return lhs;
}