[clang-tidy] New check: modernize-replace-random-shuffle.
authorMads Ravn <madsravn@gmail.com>
Mon, 24 Apr 2017 09:27:20 +0000 (09:27 +0000)
committerMads Ravn <madsravn@gmail.com>
Mon, 24 Apr 2017 09:27:20 +0000 (09:27 +0000)
commita301498783dd9c05f1067cdb8eea5ff4e9f9a059
treebe12b3057ac97b9ce9515d798d7bcb28a2a99d97
parentf53865daa41d0c520a2afd2618e9a00fed448528
[clang-tidy] New check: modernize-replace-random-shuffle.

This check will find occurrences of ``std::random_shuffle`` and replace it with ``std::shuffle``. In C++17 ``std::random_shuffle`` will no longer be available and thus we need to replace it.

Example of case that it fixes

```
  std::vector<int> v;

  // First example
  std::random_shuffle(vec.begin(), vec.end());

```

Reviewers: hokein, aaron.ballman, alexfh, malcolm.parsons, mclow.lists

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D30158

llvm-svn: 301167
clang-tools-extra/clang-tidy/modernize/CMakeLists.txt
clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-replace-random-shuffle.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/modernize-replace-random-shuffle.cpp [new file with mode: 0644]