LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 25004 - modernize-loop-convert to suggest usage of algorithms
Summary: modernize-loop-convert to suggest usage of algorithms
Status: NEW
Alias: None
Product: clang-tools-extra
Classification: Unclassified
Component: clang-tidy (show other bugs)
Version: unspecified
Hardware: All All
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-30 16:19 PDT by Eugene Zelenko
Modified: 2021-09-03 18:35 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Zelenko 2015-09-30 16:19:41 PDT
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.
Comment 1 Manuel Klimek 2015-10-01 04:37:52 PDT
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.
Comment 2 Eugene Zelenko 2017-04-21 14:21:29 PDT
Parasoft DTP has such check to suggest usage of algorithms instead of loops (STL-33)
Comment 3 Eugene Zelenko 2021-09-03 18:35:20 PDT
Partially implemented in readability-use-anyofallof.