------- Comment #5 from roger at eyesopen dot com 2006-12-01 04:04 ------- >> This needs to be handled in the front-ends... > ^^^^^ should ^^^^^^ can only be
I was thinking of a slightly weaker form of need/must. But there are two issues here. The division by zero is one, but its also a red herring, we really shouldn't be accepting the code: int x; enum e { E = 0 * x }; which currently compiles without even a warning using -pedantic-errors. This is exactly the sort of thing that Joseph's struct c_expr were intended to handle. I don't think is unreasonable for fold to convert "0 * x" into 0, the issue is that a front-end can't really look at a folded tree and determine anything much about the original source code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19976