On 08/29/2015 10:10 AM, Kai Tietz wrote:
Hmm, I don't think we want to call maybe_constant_value in functions like cp_build_binary_op. We are interested in overflow only on constant-values anyway, I don't see that we want to have here any constexpr-logic, nor specific address-manipulation logic. So I see here not much advantage in using maybe_constant_value. Maybe I simply not seeing the obvious here. Do you have a specific testcase, which shows what diagnostics could be missed?
#include <limits.h> constexpr int f() { return INT_MAX; } int main() { return f()+2; // { dg-warning "overflow" } } Jason