clang-tidy explicit constructor check: don't warn on copy or move constructors.
Summary:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors
"The exception is copy constructors, which, in the rare cases when we allow
them, should probably not be explicit."
Reviewers: klimek
Reviewed By: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3122
llvm-svn: 204322
diff --git a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
index 56bc443..b09afe2 100644
--- a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
@@ -12,8 +12,12 @@
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&); };");
+ EXPECT_NO_CHANGES(ExplicitConstructorCheck, "class C { C(C&&); };");
EXPECT_NO_CHANGES(ExplicitConstructorCheck,
"class C { C(const C&) = delete; };");
+ EXPECT_NO_CHANGES(ExplicitConstructorCheck,
+ "class C { C(int) = delete; };");
}
TEST(ExplicitConstructorCheckTest, Basic) {