Mark Mitchell wrote:
I'm nervous about the warning->error change for division by zero in
build_binary_op; isn't this a valid C++ function:
int f(int i) { return i / 0; }
even though any call to it will result in undefined behavior?
Yes, you are right, we should not reject this and my change to build_binary_op
is invalid (it didn't trigger in a full test cycle though, I will add a
testcase like the one you proposed later with my patch).
The problem is that when we tsubst A%B (for either A or B template parameters),
we end up with an expression like "3 % 0" marked with TREE_CONSTANT but that is
not a constant expression in the C++ sense (I can't allow it as a template
argument, as far as I can tell).