diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-01-21 17:56:24 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-01-21 17:56:24 +0000 |
commit | a415a1d0d7ba556f739d642c87d7c33b5c827ee5 (patch) | |
tree | 37d8c032e87fb39aa68db36c387344581a240686 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | e3e6be2aabbb50b6093e3ce05b9cdea56a088084 (diff) | |
download | bcm5719-llvm-a415a1d0d7ba556f739d642c87d7c33b5c827ee5.tar.gz bcm5719-llvm-a415a1d0d7ba556f739d642c87d7c33b5c827ee5.zip |
Add an isVirtualAsWritten AST matcher.
http://reviews.llvm.org/D16394
llvm-svn: 258415
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 3cf396a4fd9..b6983052dd8 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -2028,6 +2028,16 @@ TEST(Matcher, MatchesVirtualMethod) { EXPECT_TRUE(notMatches("class X { int f(); };", cxxMethodDecl(isVirtual()))); } +TEST(Matcher, MatchesVirtualAsWrittenMethod) { + EXPECT_TRUE(matches("class A { virtual int f(); };" + "class B : public A { int f(); };", + cxxMethodDecl(isVirtualAsWritten(), hasName("::A::f")))); + EXPECT_TRUE( + notMatches("class A { virtual int f(); };" + "class B : public A { int f(); };", + cxxMethodDecl(isVirtualAsWritten(), hasName("::B::f")))); +} + TEST(Matcher, MatchesPureMethod) { EXPECT_TRUE(matches("class X { virtual int f() = 0; };", cxxMethodDecl(isPure(), hasName("::X::f")))); |