]> granicus.if.org Git - clang/commitdiff
Add a test case to test RAV visits parameters of implicit copy constructor.
authorMichael Han <fragmentshaders@gmail.com>
Thu, 12 Sep 2013 20:59:33 +0000 (20:59 +0000)
committerMichael Han <fragmentshaders@gmail.com>
Thu, 12 Sep 2013 20:59:33 +0000 (20:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190632 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Tooling/RecursiveASTVisitorTest.cpp

index b3a8915a59de5718979659cd23c0027790ba9802..323476766e9291e4254d7084fdd6a61c70c1d551 100644 (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) {