From: Michael Han Date: Thu, 12 Sep 2013 20:59:33 +0000 (+0000) Subject: Add a test case to test RAV visits parameters of implicit copy constructor. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bb3ca348517516a92579526b7f878279f33f32e;p=clang Add a test case to test RAV visits parameters of implicit copy constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190632 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Tooling/RecursiveASTVisitorTest.cpp b/unittests/Tooling/RecursiveASTVisitorTest.cpp index b3a8915a59..323476766e 100644 --- a/unittests/Tooling/RecursiveASTVisitorTest.cpp +++ b/unittests/Tooling/RecursiveASTVisitorTest.cpp @@ -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) {