[cfe-commits] r135222 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaCXX/expressions.cpp
Douglas Gregor
dgregor at apple.com
Thu Jul 14 17:56:59 PDT 2011
On Jul 14, 2011, at 5:49 PM, Richard Trieu wrote:
>
> Unless I misunderstood the effect, it also eliminates some true positives as well, in code like
>
> if (dependent-thing && 0)
>
>
> This change will still catch such an example, since the value-dependent check is only on the right hand side. If you check the test cases, there is an example of such a thing. See the excerpt of the test below.
>
> +template<unsigned int A, unsigned int B> struct S
> ...
> + e2 = A && 7 // expected-warning {{use of logical && with constant operand; switch to bitwise & or remove constant}}
> ...
> + int y = B && 3; // expected-warning {{use of logical && with constant operand; switch to bitwise & or remove constant}}
Interesting, okay. Then the patch looks fine; thanks!
- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110714/859d4c38/attachment.html>
More information about the cfe-commits
mailing list