summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
diff options
context:
space:
mode:
authorJonas Toth <jonas.toth@gmail.com>2019-01-09 20:50:50 +0000
committerJonas Toth <jonas.toth@gmail.com>2019-01-09 20:50:50 +0000
commitca8e20cdf76b5cc59159c315d35e6968f8879cb3 (patch)
treefb48861015f27e612d4d277edc2d5b637603c3cd /clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
parent67796064c76e921de8a5c07a25cecafc215d71e2 (diff)
downloadbcm5719-llvm-ca8e20cdf76b5cc59159c315d35e6968f8879cb3.tar.gz
bcm5719-llvm-ca8e20cdf76b5cc59159c315d35e6968f8879cb3.zip
[clang-tidy] Adding a new modernize use nodiscard checker
Summary: Adds a checker to clang-tidy to warn when a non void const member function, taking only parameters passed by value or const reference could be marked as '[[nodiscard]]' Patch by MyDeveloperDay. Reviewers: alexfh, stephenkelly, curdeius, aaron.ballman, hokein, JonasToth Reviewed By: curdeius, JonasToth Subscribers: Eugene.Zelenko, lefticus, lebedev.ri, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55433 llvm-svn: 350760
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
index 6bad6cbefa9..fcf535b76ae 100644
--- a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
@@ -32,6 +32,7 @@
#include "UseEmplaceCheck.h"
#include "UseEqualsDefaultCheck.h"
#include "UseEqualsDeleteCheck.h"
+#include "UseNodiscardCheck.h"
#include "UseNoexceptCheck.h"
#include "UseNullptrCheck.h"
#include "UseOverrideCheck.h"
@@ -82,6 +83,8 @@ public:
CheckFactories.registerCheck<UseEqualsDefaultCheck>("modernize-use-equals-default");
CheckFactories.registerCheck<UseEqualsDeleteCheck>(
"modernize-use-equals-delete");
+ CheckFactories.registerCheck<UseNodiscardCheck>(
+ "modernize-use-nodiscard");
CheckFactories.registerCheck<UseNoexceptCheck>("modernize-use-noexcept");
CheckFactories.registerCheck<UseNullptrCheck>("modernize-use-nullptr");
CheckFactories.registerCheck<UseOverrideCheck>("modernize-use-override");
OpenPOWER on IntegriCloud