summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.h')
-rw-r--r--clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.h b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.h
index 27aa06f9f2d..85764720652 100644
--- a/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.h
+++ b/clang-tools-extra/clang-tidy/misc/MoveConstantArgumentCheck.h
@@ -16,12 +16,24 @@ namespace clang {
namespace tidy {
namespace misc {
+/// Find casts of calculation results to bigger type. Typically from int to
+///
+/// There is one option:
+///
+/// - `CheckTriviallyCopyableMove`: Whether to check for trivially-copyable
+// types as their objects are not moved but copied. Enabled by default.
class MoveConstantArgumentCheck : public ClangTidyCheck {
public:
MoveConstantArgumentCheck(StringRef Name, ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {}
+ : ClangTidyCheck(Name, Context),
+ CheckTriviallyCopyableMove(
+ Options.get("CheckTriviallyCopyableMove", true)) {}
+ void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
+
+private:
+ const bool CheckTriviallyCopyableMove;
};
} // namespace misc
OpenPOWER on IntegriCloud