Re: [clang] 1d1b089 - Fix more unused lambda capture warnings, NFC

2022-03-06 Thread David Blaikie via cfe-commits
On Mon, Feb 28, 2022 at 10:12 AM Reid Kleckner wrote: > I agree, but clearly this person chose a particular style, and I wasn't > trying to revise their code style, just to fix some the Bazel build, which > uses -Werror. > Oh, wow, yeah, this file/corner of the codebase is deep into lambdas,

Re: [clang] 1d1b089 - Fix more unused lambda capture warnings, NFC

2022-02-28 Thread Reid Kleckner via cfe-commits
I agree, but clearly this person chose a particular style, and I wasn't trying to revise their code style, just to fix some the Bazel build, which uses -Werror. The way that `assert` can affect a lambda's capture list seems like a particularly good argument for having a project wide style

Re: [clang] 1d1b089 - Fix more unused lambda capture warnings, NFC

2022-02-28 Thread David Blaikie via cfe-commits
FWIW, I think it's probably simpler/more maintainable to default capture by reference ("[&]") if a lambda doesn't escape its scope (if it's never type erased/put in a std::function or equivalent). Avoids assert/non-assert unused issues, having to maintain/update the list when the code changes and

[clang] 1d1b089 - Fix more unused lambda capture warnings, NFC

2022-02-23 Thread Reid Kleckner via cfe-commits
Author: Reid Kleckner Date: 2022-02-23T14:07:04-08:00 New Revision: 1d1b089c5d503e2fc8697887411730105f66c774 URL: https://github.com/llvm/llvm-project/commit/1d1b089c5d503e2fc8697887411730105f66c774 DIFF: https://github.com/llvm/llvm-project/commit/1d1b089c5d503e2fc8697887411730105f66c774.diff