HomePhabricator

[clang-tidy] Add 'bugprone-easily-swappable-parameters' check

Authored by whisperity on Oct 29 2019, 5:52 AM.

Description

[clang-tidy] Add 'bugprone-easily-swappable-parameters' check

Finds function definitions where parameters of convertible types follow
each other directly, making call sites prone to calling the function
with swapped (or badly ordered) arguments.

Such constructs are usually the result of inefficient design and lack of
exploitation of strong type capabilities that are possible in the
language.

This check finds and flags function definitions and not call
sites!

Reviewed By: aaron.ballman, alexfh

Differential Revision: http://reviews.llvm.org/D69560