[PATCH] D148340: [clang-tidy] Apply cppcoreguidelines-avoid-capture-default-when-capturin-this only to by-value capture default

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 14 12:03:55 PDT 2023


carlosgalvezp marked an inline comment as done.
carlosgalvezp added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp:55
+        AvoidByValueCaptureDefaultWhenCapturingThisCheck>(
+        "cppcoreguidelines-avoid-by-value-capture-default-when-capturing-this");
     CheckFactories.registerCheck<AvoidCapturingLambdaCoroutinesCheck>(
----------------
PiotrZSL wrote:
> PiotrZSL wrote:
> > this name is hard to understand
> > 
> > I asked ChatGPT about it, and here are some other proposals:
> > 
> > - cppcoreguidelines-avoid-by-value-default-this-capture
> > - cppcoreguidelines-avoid-this-capture-by-value-default
> > - cppcoreguidelines-explicit-this-capture-by-value
> > - cppcoreguidelines-implicit-this-capture-by-value
> > - cppcoreguidelines-implicit-by-value-this-capture
> > - cppcoreguidelines-prefer-explicit-this-capture
> > - cppcoreguidelines-avoid-ambiguous-this-capture
> Probably something like this would be good:
> cppcoreguidelines-avoid-implicit-this-capture-by-value
Nice suggestions! I've done a bit of mix of them, let me know if you are happy with it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148340/new/

https://reviews.llvm.org/D148340



More information about the cfe-commits mailing list