summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-03-19 12:48:22 +0000
committerAlexander Kornienko <alexfh@google.com>2014-03-19 12:48:22 +0000
commitf9a7b46ec6d350c77857d0c982c7c44878693f61 (patch)
treef215f0cec5d4a07d08a9f8eee05edb7564fde33e /clang-tools-extra/unittests/clang-tidy
parent2ea796e05f586e585f1f62c718245cfed78b0130 (diff)
downloadbcm5719-llvm-f9a7b46ec6d350c77857d0c982c7c44878693f61.tar.gz
bcm5719-llvm-f9a7b46ec6d350c77857d0c982c7c44878693f61.zip
clang-tidy explicit constructors check: don't warn on deleted constructors.
Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3116 llvm-svn: 204226
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h5
-rw-r--r--clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp2
2 files changed, 5 insertions, 2 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h
index f42a57649d1..6248d0cb2e5 100644
--- a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h
+++ b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h
@@ -46,13 +46,14 @@ template <typename T> std::string runCheckOnCode(StringRef Code) {
ClangTidyDiagnosticConsumer DiagConsumer(Context);
Check.setContext(&Context);
- if (!tooling::runToolOnCode(new TestPPAction(Check, &Context), Code))
+ if (!tooling::runToolOnCodeWithArgs(new TestPPAction(Check, &Context), Code,
+ {"-std=c++11"}))
return "";
ast_matchers::MatchFinder Finder;
Check.registerMatchers(&Finder);
std::unique_ptr<tooling::FrontendActionFactory> Factory(
tooling::newFrontendActionFactory(&Finder));
- if (!tooling::runToolOnCode(Factory->create(), Code))
+ if (!tooling::runToolOnCodeWithArgs(Factory->create(), Code, {"-std=c++11"}))
return "";
DiagConsumer.finish();
tooling::Replacements Fixes;
diff --git a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
index 476ab39fe23..56bc443cbe2 100644
--- a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
@@ -12,6 +12,8 @@ namespace test {
TEST(ExplicitConstructorCheckTest, SingleArgumentConstructorsOnly) {
EXPECT_NO_CHANGES(ExplicitConstructorCheck, "class C { C(); };");
EXPECT_NO_CHANGES(ExplicitConstructorCheck, "class C { C(int i, int j); };");
+ EXPECT_NO_CHANGES(ExplicitConstructorCheck,
+ "class C { C(const C&) = delete; };");
}
TEST(ExplicitConstructorCheckTest, Basic) {
OpenPOWER on IntegriCloud