[PATCH] D137205: [clang-tidy] Add performance-unnecessary-copy-on-last-use check

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 13 03:18:19 PST 2022


njames93 added inline comments.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/performance/unnecessary-copy-on-last-use.rst:50
+
+   A string specifying which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
----------------
Febbe wrote:
> Eugene.Zelenko wrote:
> > Could such option be shared between different checks? Or even rely on `.clang-format`?
> I just oriented myself at other similar checks, which introduced this. It uses both there:
> 
> ```
> UnnecessaryCopyOnLastUseCheck::UnnecessaryCopyOnLastUseCheck(
>     StringRef Name, ClangTidyContext *Context)
>     : ClangTidyCheck(Name, Context),
>       Inserter(Options.getLocalOrGlobal("IncludeStyle",
>                                         utils::IncludeSorter::IS_LLVM),
> ```
> 
> Do you mean, that I can just remove the description of the option, because it is taken from global options?
I'm personally of the idea that it should be removed. However that's out of the scope for this patch so for now thist should stick with the current convention.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137205



More information about the cfe-commits mailing list