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

Michael Han fragmentshaders at gmail.com
Thu Sep 12 13:59:33 PDT 2013


Author: hanm
Date: Thu Sep 12 15:59:33 2013
New Revision: 190632

URL: http://llvm.org/viewvc/llvm-project?rev=190632&view=rev
Log:
Add a test case to test RAV visits parameters of implicit copy constructor.


Modified:
    cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp

Modified: cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp?rev=190632&r1=190631&r2=190632&view=diff
==============================================================================
--- cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp Thu Sep 12 15:59:33 2013
@@ -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) {





More information about the cfe-commits mailing list