summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-07-16 10:00:14 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-07-16 10:00:14 +0000
commitb1039759fb2d513f843030a16458d8420566abb6 (patch)
tree74705d124ec9cab64c3b8d24dcce647ee0c0d0bb /clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
parent2e9427a175cf47b4f812a930fc43398c15a4adcf (diff)
downloadbcm5719-llvm-b1039759fb2d513f843030a16458d8420566abb6.tar.gz
bcm5719-llvm-b1039759fb2d513f843030a16458d8420566abb6.zip
[clang-tidy] Add a checker that warns on const string & members.
Summary: Those are considered unsafe and should be replaced with simple pointers or full copies. It recognizes both std::string and ::string. Reviewers: alexfh, djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4522 llvm-svn: 213133
Diffstat (limited to 'clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
index 36e11d4cef9..43eacfc39e2 100644
--- a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
@@ -15,6 +15,7 @@
#include "ExplicitMakePairCheck.h"
#include "NamedParameterCheck.h"
#include "OverloadedUnaryAndCheck.h"
+#include "StringReferenceMemberCheck.h"
using namespace clang::ast_matchers;
@@ -34,6 +35,9 @@ public:
"google-runtime-operator",
new ClangTidyCheckFactory<runtime::OverloadedUnaryAndCheck>());
CheckFactories.addCheckFactory(
+ "google-runtime-member-string-references",
+ new ClangTidyCheckFactory<runtime::StringReferenceMemberCheck>());
+ CheckFactories.addCheckFactory(
"google-readability-casting",
new ClangTidyCheckFactory<readability::AvoidCStyleCastsCheck>());
CheckFactories.addCheckFactory(
OpenPOWER on IntegriCloud