Skip to content

clang-tidy modernize-avoid-bind#2972

Closed
rhaschke wants to merge 5 commits intomoveit:masterfrom
ubi-agni:modernize
Closed

clang-tidy modernize-avoid-bind#2972
rhaschke wants to merge 5 commits intomoveit:masterfrom
ubi-agni:modernize

Conversation

@rhaschke
Copy link
Contributor

Address #2766 employing clang-tidy's modernize-avoid-bind. This has several shortcomings:

  • clang-tidy-10, which is used by default in Ubuntu 20.04, doesn't turn placeholder arguments into lambda arguments 😞
  • clang-tidy-12 fixes this, but the generated argument names are PH1, PH2, etc. and their type is auto&&. Not very readible!
  • clang-tidy-12 doesn't yet consider return values of bound functions 😞

@v4hn, should we really continue along that path?

clang-tidy-10 doesn't replace placeholder arguments with lambda arguments!
clang-tidy-12 doesn't consider return values of bound functions
@v4hn
Copy link
Contributor

v4hn commented Mar 25, 2022

@v4hn, should we really continue along that path?

I know it's been a while, but if somehow possible I would like to add the clang-format flag, yes.
BUT of course someone needs to give the variables proper names and new contributors cannot just apply the suggestion from CI to fix their code.
The latter part is not a big deal for me because people should just realize that the names are not ok. The former part is a lot of work, but is basically waiting for someone to step up, lookup the function signatures and turn the lambdas into something readable and informative. :-)

@v4hn v4hn added help wanted please consider improving this request! more work needed Everyone is invited to contribute good first issue If you want to contribute work for the first time, look at this labels Mar 25, 2022
@v4hn v4hn closed this Mar 31, 2022
@v4hn v4hn mentioned this pull request Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue If you want to contribute work for the first time, look at this help wanted please consider improving this request! more work needed Everyone is invited to contribute

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants