summaryrefslogtreecommitdiff
path: root/unittests/ASTMatchers
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@gmail.com>2014-05-16 19:31:08 +0000
committerJoey Gouly <joey.gouly@gmail.com>2014-05-16 19:31:08 +0000
commit2cfcfd2aa5481b00614edcdf8399c6ffa3937bba (patch)
treea8c94949bf3302d68d14bde44bd6a2e9938ffa2c /unittests/ASTMatchers
parent0bfe35e3c6204ff0c1c8620d694db55ba86896c3 (diff)
downloadclang-2cfcfd2aa5481b00614edcdf8399c6ffa3937bba.tar.gz
clang-2cfcfd2aa5481b00614edcdf8399c6ffa3937bba.tar.bz2
clang-2cfcfd2aa5481b00614edcdf8399c6ffa3937bba.tar.xz
[ASTMatchers] Move the 'isImplicit' matcher from CXXConstructorDecl to Decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers')
-rw-r--r--unittests/ASTMatchers/ASTMatchersTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp
index 5d09700e6e..e7d99242fc 100644
--- a/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -1773,6 +1773,9 @@ TEST(ConstructorDeclaration, IsImplicit) {
constructorDecl(isImplicit())));
EXPECT_TRUE(matches("class Foo { Foo(){} };",
constructorDecl(unless(isImplicit()))));
+ // The compiler added an implicit assignment operator.
+ EXPECT_TRUE(matches("struct A { int x; } a = {0}, b = a; void f() { a = b; }",
+ methodDecl(isImplicit(), hasName("operator="))));
}
TEST(DestructorDeclaration, MatchesVirtualDestructor) {