diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2016-01-18 20:37:44 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2016-01-18 20:37:44 +0000 |
commit | eb85b04c7eccad93706d7e7e319a34597f521ac6 (patch) | |
tree | 56b9aa57cf8c7ed6c72a3820cb4eb4e17eed8d99 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | 5e46adb09a6aac616e3b469d3bb6682fa4160d2b (diff) | |
download | bcm5719-llvm-eb85b04c7eccad93706d7e7e319a34597f521ac6.tar.gz bcm5719-llvm-eb85b04c7eccad93706d7e7e319a34597f521ac6.zip |
Add an AST matcher for checking whether a function is defaulted.
Patch by Jonathan Coe.
llvm-svn: 258072
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index c76100a433c..5fde0ff504f 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -1814,6 +1814,13 @@ TEST(IsExternC, MatchesExternCFunctionDeclarations) { EXPECT_TRUE(notMatches("void f() {}", functionDecl(isExternC()))); } +TEST(IsDefaulted, MatchesDefaultedFunctionDeclarations) { + EXPECT_TRUE( + notMatches("class A { ~A(); };", functionDecl(hasName("A"), isDefaulted()))); + EXPECT_TRUE(matches("class B { ~B() = default; };", + functionDecl(hasName("B"), isDefaulted()))); +} + TEST(IsDeleted, MatchesDeletedFunctionDeclarations) { EXPECT_TRUE( notMatches("void Func();", functionDecl(hasName("Func"), isDeleted()))); |