Test cases?

>Examples:
>int x = ~y | ~z;
>Fixed with | => ||

The code `~y | ~z` looks reasonable to me. It's equivalent to `~(y & z)`, 
a.k.a. "all the flags that aren't part of either `y` or `z`".
Did you mean to denigrate `!y | !z` instead? In //that// case, the fixit `|` => 
`||` would definitely be appropriate IMHO.

>bool a = ~b && !c
>Fixed with ~b => !b

I wouldn't expect the compiler to suggest a fixit in this case, but if it did, 
this code is sufficiently confusing that I personally would rather see the 
compiler suggest `~b` => `(b != -1)`, rather than suggesting a fixit that 
quietly changes the meaning of the code.

http://reviews.llvm.org/D5765



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to