[LLVMdev] Is this a bug in clang?

John Regehr
2011-04-20T18:37:35Z

> It's the evaluation of the expression "i++ + i++" that result
in undefined
> behavior. If you merely compile a program that contains the expression, the
> expression is never evaluated. You need to execute the program to have the
> expression be evaluated and behavior be undefined.

I don't think this is correct.  The standard does not make much of a
distinction between compile time and run time, there is merely a "C
implementation."

> For example, also, if you do `sizeof(i++ + i++)`, this behavior is
perfectly
> fine, and not undefined behavior. Because the `i++` is not evaluated.

Probably also wrong.

John