Add a test case to test RAV visits parameters of implicit copy constructor.

llvm-svn: 190632
This commit is contained in:
Michael Han 2013-09-12 20:59:33 +00:00
parent de7485af55
commit 6ca01b4b6c
1 changed files with 7 additions and 3 deletions

View File

@ -156,17 +156,21 @@ public:
};
// Test RAV visits parameter variable declaration of the implicit
// copy assignment operator.
// copy assignment operator and implicit copy constructor.
TEST(RecursiveASTVisitor, VisitsParmVarDeclForImplicitCode) {
ParmVarDeclVisitorForImplicitCode Visitor;
// Match parameter variable name of implicit copy assignment operator.
// Match parameter variable name of implicit copy assignment operator and
// implicit copy constructor.
// This parameter name does not have a valid IdentifierInfo, and shares
// same SourceLocation with its class declaration, so we match an empty name
// with the class' source location.
Visitor.ExpectMatch("", 1, 7);
Visitor.ExpectMatch("", 3, 7);
EXPECT_TRUE(Visitor.runOver(
"class X {};\n"
"void foo(X a, X b) {a = b;}"));
"void foo(X a, X b) {a = b;}\n"
"class Y {};\n"
"void bar(Y a) {Y b = a;}"));
}
TEST(RecursiveASTVisitor, VisitsBaseClassDeclarations) {