Can I detect (and warn on) redundancies at compile time?
<p>Is there any way I can catch and warn about redundancies at compile time?</p>

<p>Such as</p>

<pre><code>if (abc &amp;&amp; abc)
</code></pre>

<p>or</p>

<pre><code>if (def || def)
</code></pre>

<hr>

<p>Ok, this isn't actually from an optimisation point of view - I'm thinking more along the lines of a mistake in code - so when the coder intended to write</p>

<pre><code>if (abc &amp;&amp; abc)
</code></pre>

<p>when actually they meant to write</p>

<pre><code>if (abc &amp;&amp; def)
</code></pre>

<p>The compiler is going to silently optimise away the mistake, whereas I actually want to know if I can get the compiler to warn me if that has happened, in case it's in there by mistake!</p>
