[cfe-commits] [Patch] When inside template instantiations, prevent warnings on constant operands of logical operators.
Chandler Carruth
chandlerc at google.com
Thu Jul 14 16:51:01 PDT 2011
Looks great, please commit!
On Thu, Jul 14, 2011 at 4:36 PM, Richard Trieu <rtrieu at google.com> wrote:
> Remove warnings of constant operands of logical operators from template
> instantiations. Upon instantiation of template, value-dependent parameters
> are replaced by equivalent literals, so code like:
>
> template<unsigned int A, unsigned int B> struct S {
> int foo() {
> int x = A && B;
> }
> }
>
> will not warn on A && B on every instantiation. This will still warn on
> other cases inside templates, which will be caught on checking the template
> definition.
>
> Patch attached and available at http://codereview.appspot.com/4650076/
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110714/a69f631d/attachment.html>
More information about the cfe-commits
mailing list