[cfe-commits] r162511 - /cfe/trunk/unittests/AST/DeclPrinterTest.cpp

Dmitri Gribenko gribozavr at gmail.com
Thu Aug 23 17:26:26 PDT 2012


Author: gribozavr
Date: Thu Aug 23 19:26:25 2012
New Revision: 162511

URL: http://llvm.org/viewvc/llvm-project?rev=162511&view=rev
Log:
DeclPrinter tests: add two more tests.

Modified:
    cfe/trunk/unittests/AST/DeclPrinterTest.cpp

Modified: cfe/trunk/unittests/AST/DeclPrinterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/DeclPrinterTest.cpp?rev=162511&r1=162510&r2=162511&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/DeclPrinterTest.cpp (original)
+++ cfe/trunk/unittests/AST/DeclPrinterTest.cpp Thu Aug 23 19:26:25 2012
@@ -498,6 +498,29 @@
     // WRONG; Should be: "A() = delete;"
 }
 
+TEST(DeclPrinter, TestCXXConstructorDecl10) {
+  ASSERT_TRUE(PrintedDeclCXX11Matches(
+    "template<typename... T>"
+    "struct A {"
+    "  A(const A &a);"
+    "};",
+    constructor(ofClass(hasName("A"))).bind("id"),
+    ""));
+    // WRONG; Should be: "A(const A &a);"
+}
+
+TEST(DeclPrinter, TestCXXConstructorDecl11) {
+  ASSERT_TRUE(PrintedDeclCXX11Matches(
+    "template<typename... T>"
+    "struct A : public T... {"
+    "  A(T&&... ts) : T(ts)... {}"
+    "};",
+    constructor(ofClass(hasName("A"))).bind("id"),
+    "A<T...>(T &&ts...) : T(ts)"));
+    // Should be: "A(T&&... ts) : T(ts)..."
+}
+
+
 TEST(DeclPrinter, TestCXXDestructorDecl1) {
   ASSERT_TRUE(PrintedDeclMatches(
     "struct A {"





More information about the cfe-commits mailing list