summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-02-13 10:11:48 +0000
committerAlexander Kornienko <alexfh@google.com>2014-02-13 10:11:48 +0000
commit32eaa37b15857987d7b26fe3dad939db24465690 (patch)
tree4bf37bbb63d3eb3c69ed77d1cc2f78695a18c1f8 /clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
parentc4b4924a13293c2ddd299a2eed7dc9c6479715d5 (diff)
downloadbcm5719-llvm-32eaa37b15857987d7b26fe3dad939db24465690.tar.gz
bcm5719-llvm-32eaa37b15857987d7b26fe3dad939db24465690.zip
Fix ExplicitConstructorCheck to warn only on in-class declarations.
Summary: I'm not absolutely sure this is 100% correct solution, but it seems to do what I expect. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2756 llvm-svn: 201308
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
index 4d340433316..48433f4fbd8 100644
--- a/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/GoogleModuleTest.cpp
@@ -21,5 +21,10 @@ TEST_F(ExplicitConstructorCheckTest, DefaultParameters) {
runCheckOn("class C { C(int i, int j = 0); };"));
}
+TEST_F(ExplicitConstructorCheckTest, OutOfLineDefinitions) {
+ EXPECT_EQ("class C { explicit C(int i); }; C::C(int i) {}",
+ runCheckOn("class C { C(int i); }; C::C(int i) {}"));
+}
+
} // namespace tidy
} // namespace clang
OpenPOWER on IntegriCloud