Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Aaron Ballman via cfe-commits
On Thu, Jan 19, 2017 at 8:45 AM, Malcolm Parsons wrote: > On 19 January 2017 at 13:16, Aaron Ballman wrote: >> I wasn't thinking about that kind of odr-unuse when reviewing your >> patch, so I am starting to think that perhaps it's not worth >> distinguishing unevaluated contexts or not in the di

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Malcolm Parsons via cfe-commits
On 19 January 2017 at 13:16, Aaron Ballman wrote: > I wasn't thinking about that kind of odr-unuse when reviewing your > patch, so I am starting to think that perhaps it's not worth > distinguishing unevaluated contexts or not in the diagnostic. :-( If > we could do it, then great (we seem to be a

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Aaron Ballman via cfe-commits
On Thu, Jan 19, 2017 at 7:49 AM, Aaron Ballman wrote: > On Thu, Jan 19, 2017 at 4:37 AM, Malcolm Parsons > wrote: >> On 19 January 2017 at 03:47, Aaron Ballman wrote: >>> It is not used in an unevaluated context -- that is a bug. >> >> It is an evaluated expression, but is it odr-used? >> >> C++

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Malcolm Parsons via cfe-commits
On 19 January 2017 at 12:49, Aaron Ballman wrote: > You are correct, it is not an odr use. MSVC is wrong to require the capture. Should the warning be rephrased? -- Malcolm Parsons ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Aaron Ballman via cfe-commits
On Thu, Jan 19, 2017 at 4:37 AM, Malcolm Parsons wrote: > On 19 January 2017 at 03:47, Aaron Ballman wrote: >> It is not used in an unevaluated context -- that is a bug. > > It is an evaluated expression, but is it odr-used? > > C++14 [basic.def.odr] p3: > > A variable x whose name appears as a p

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-19 Thread Malcolm Parsons via cfe-commits
On 19 January 2017 at 03:47, Aaron Ballman wrote: > It is not used in an unevaluated context -- that is a bug. It is an evaluated expression, but is it odr-used? C++14 [basic.def.odr] p3: A variable x whose name appears as a potentially-evaluated expression ex is odr-used by ex unless applying

Re: [PATCH] D28467: [Sema] Add warning for unused lambda captures

2017-01-18 Thread Aaron Ballman via cfe-commits
On Jan 18, 2017 7:34 PM, "Akira Hatanaka via Phabricator" < revi...@reviews.llvm.org> wrote: ahatanak added a comment. In https://reviews.llvm.org/D28467#649861, @krasin wrote: > This change makes Clang hardly incompatible with MSVC++. Consider the following program: > > #include > > int ma