Skip to content

New check suggestion: use LLVM STLExtras range-based API #38468

Open
@kirillbobyrev

Description

@kirillbobyrev
Bugzilla Link 39120
Version unspecified
OS All
CC @JonasToth

Extended Description

LLVM has include/llvm/STLExtras.h full of Standard Library function replacements with more convenient API leveraging ranges, such as

void llvm::sort (Container &&C)
void llvm::sort (Container &&C, Compare Comp)
auto llvm::find (R &&Range, const T &Val) -> decltype(adl_begin(Range))
UnaryPredicate llvm::for_each (R &&Range, UnaryPredicate P)
...

There are several patches with manual cleanups (D52576, D52650) and it would be nice to

  • automatically detect these cases
  • enforce readability by providing diagnostics later on

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillacheck-requestRequest for a new check in clang-tidyclang-tidy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions