Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize-loop-convert to suggest usage of algorithms #25378

Open
EugeneZelenko opened this issue Sep 30, 2015 · 3 comments
Open

modernize-loop-convert to suggest usage of algorithms #25378

EugeneZelenko opened this issue Sep 30, 2015 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang-tidy enhancement Improving things as opposed to bug fixing, e.g. new or missing feature

Comments

@EugeneZelenko
Copy link
Contributor

Bugzilla Link 25004
Version unspecified
OS All

Extended Description

I run modernize-loop-convert over LLVM code and looked on headers and in all cases algorithms (find, find_if, any_of, copy_if) seems better solution then loop conversion, so I think will be good idea to enhance modernize-loop-convert to suggest at least algorithm family.

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 1, 2015

I think this is not the right fit for modernize-loop-convert.

Using an algorithm vs. a loop is often a conscious decision; algorithms were often already there prior to new versions of the language.

I do think, though, that having a clang-tidy check readability-use-algorithm or something that suggests to use the right algorithm would be an excellent addition to clang-tidy.

@EugeneZelenko
Copy link
Contributor Author

Parasoft DTP has such check to suggest usage of algorithms instead of loops (STL-33)

@EugeneZelenko
Copy link
Contributor Author

Partially implemented in readability-use-anyofallof.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@EugeneZelenko EugeneZelenko added the enhancement Improving things as opposed to bug fixing, e.g. new or missing feature label Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-tidy enhancement Improving things as opposed to bug fixing, e.g. new or missing feature
Projects
None yet
Development

No branches or pull requests

2 participants