diff options
-rw-r--r-- | clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp | 3 | ||||
-rw-r--r-- | clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp index a150a8c43ec..a732242f778 100644 --- a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp @@ -71,7 +71,8 @@ void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) { Ctor->getOuterLocStart(), Ctor->getLocEnd(), isKWExplicit); if (ExplicitTokenRange.isValid()) { DiagnosticBuilder Diag = diag(ExplicitTokenRange.getBegin(), - "Copy constructor declared explicit."); + "%0 constructor declared explicit.") + << (Ctor->isMoveConstructor() ? "Move" : "Copy"); Diag << FixItHint::CreateRemoval( CharSourceRange::getCharRange(ExplicitTokenRange)); } diff --git a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp index 3c024b1ed7e..d986d3bcb04 100644 --- a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp +++ b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp @@ -39,12 +39,12 @@ TEST(ExplicitConstructorCheckTest, OutOfLineDefinitions) { TEST(ExplicitConstructorCheckTest, RemoveExplicit) { EXPECT_EQ("class A { A(const A&); };\n" - "class B { /*asdf*/ B(const B&); };\n" - "class C { /*asdf*/ C(const C&); };", + "class B { /*asdf*/ B(B&&); };\n" + "class C { /*asdf*/ C(const C&, int i = 0); };", runCheckOnCode<ExplicitConstructorCheck>( "class A { explicit A(const A&); };\n" - "class B { explicit /*asdf*/ B(const B&); };\n" - "class C { explicit/*asdf*/ C(const C&); };")); + "class B { explicit /*asdf*/ B(B&&); };\n" + "class C { explicit/*asdf*/ C(const C&, int i = 0); };")); } } // namespace test |