]> granicus.if.org Git - clang/commitdiff
DeclPrinter tests: add two more tests.
authorDmitri Gribenko <gribozavr@gmail.com>
Fri, 24 Aug 2012 00:26:25 +0000 (00:26 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Fri, 24 Aug 2012 00:26:25 +0000 (00:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162511 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/AST/DeclPrinterTest.cpp

index 268d48e50fa85615d1f6ff25e1de3fdb6200bd9a..b26ed93ddf8632f612ad73e68b2b2c1b8dac02b9 100644 (file)
@@ -498,6 +498,29 @@ TEST(DeclPrinter, TestCXXConstructorDecl9) {
     // 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 {"