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,
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
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
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