summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/DeclPrinterTest.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-08-24 00:26:25 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-08-24 00:26:25 +0000
commit340c0f6776a0c3e7131c904ec66dbeabd76a90e4 (patch)
tree5a7e63aaf4b748bebc5e3ec31a5626e0f5dd8da0 /clang/unittests/AST/DeclPrinterTest.cpp
parent260808c583b9c5433307e1ec2e61d53c1bafa822 (diff)
downloadbcm5719-llvm-340c0f6776a0c3e7131c904ec66dbeabd76a90e4.tar.gz
bcm5719-llvm-340c0f6776a0c3e7131c904ec66dbeabd76a90e4.zip
DeclPrinter tests: add two more tests.
llvm-svn: 162511
Diffstat (limited to 'clang/unittests/AST/DeclPrinterTest.cpp')
-rw-r--r--clang/unittests/AST/DeclPrinterTest.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp
index 268d48e50fa..b26ed93ddf8 100644
--- a/clang/unittests/AST/DeclPrinterTest.cpp
+++ b/clang/unittests/AST/DeclPrinterTest.cpp
@@ -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 {"
OpenPOWER on IntegriCloud