r337152 - [Sema] Reword warning for constant captures that are not required

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 17 06:33:44 PDT 2018


Thanks for noticing. Reverted for now in r337278. The wording is still bad,
but talking about ODR uses in there feels worse.

On Tue, Jul 17, 2018 at 1:02 PM Malcolm Parsons <malcolm.parsons at gmail.com>
wrote:

> On Mon, 16 Jul 2018 at 10:57, Benjamin Kramer via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > -  auto explicit_by_value_unused_sizeof = [i] { return sizeof(i); }; //
> expected-warning{{lambda capture 'i' is not required to be captured for
> this use}}
> > +  auto explicit_by_value_unused_sizeof = [i] { return sizeof(i); }; //
> expected-warning{{lambda capture of constant 'i' is not required for this
> use}}
>
> i is not a constant:
>
>   int i = 0;
>
> --
> Malcolm Parsons
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180717/c08a5cb9/attachment.html>


More information about the cfe-commits mailing list