When pretty-printing a declaration of a pack, put the ellipsis before the name
being declared, not at the end. When pretty-printing a non-type template
parameter, put the name of the parameter in the middle of the type, not at the
end.
llvm-svn: 213718
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp
index 5340756..9ba5979 100644
--- a/clang/unittests/AST/DeclPrinterTest.cpp
+++ b/clang/unittests/AST/DeclPrinterTest.cpp
@@ -544,6 +544,7 @@
"};",
constructorDecl(ofClass(hasName("A"))).bind("id"),
"A<T...>(const A<T...> &a)"));
+ // WRONG; Should be: "A(const A<T...> &a);"
}
TEST(DeclPrinter, TestCXXConstructorDecl11) {
@@ -553,8 +554,8 @@
" A(T&&... ts) : T(ts)... {}"
"};",
constructorDecl(ofClass(hasName("A"))).bind("id"),
- "A<T...>(T &&ts...) : T(ts)..."));
- // WRONG; Should be: "A(T&&... ts) : T(ts)..."
+ "A<T...>(T &&...ts) : T(ts)..."));
+ // WRONG; Should be: "A(T &&...ts) : T(ts)... {}"
}
TEST(DeclPrinter, TestCXXDestructorDecl1) {
@@ -1011,8 +1012,8 @@
"template<typename... T>"
"struct A { int a; };",
classTemplateDecl(hasName("A")).bind("id"),
- "template <typename ... T> struct A {\n}"));
- // Should be: with semicolon, with { ... }, without spaces before '...'
+ "template <typename ...T> struct A {\n}"));
+ // Should be: with semicolon, with { ... }
}
TEST(DeclPrinter, TestClassTemplateDecl11) {
@@ -1020,8 +1021,8 @@
"template<typename... T>"
"struct A : public T... { int a; };",
classTemplateDecl(hasName("A")).bind("id"),
- "template <typename ... T> struct A : public T... {\n}"));
- // Should be: with semicolon, with { ... }, without spaces before '...'
+ "template <typename ...T> struct A : public T... {\n}"));
+ // Should be: with semicolon, with { ... }
}
TEST(DeclPrinter, TestClassTemplatePartialSpecializationDecl1) {
@@ -1080,9 +1081,7 @@
"template<typename... T>"
"void A(T... a);",
functionTemplateDecl(hasName("A")).bind("id"),
- "template <typename ... T> void A(T a...)"));
- // WRONG; Should be: "template <typename ... T> void A(T... a)"
- // (not "T a...")
+ "template <typename ...T> void A(T ...a)"));
// Should be: with semicolon.
}
@@ -1239,7 +1238,7 @@
"};",
"A",
"Z<T...> A"));
- // Should be: with semicolon, without extra space in "> >"
+ // Should be: with semicolon
}
TEST(DeclPrinter, TestTemplateArgumentList14) {
@@ -1251,7 +1250,7 @@
"};",
"A",
"Z<Y<T>...> A"));
- // Should be: with semicolon, without extra space in "> >"
+ // Should be: with semicolon
}
TEST(DeclPrinter, TestTemplateArgumentList15) {
@@ -1262,7 +1261,7 @@
"};",
"A",
"Z<sizeof...(T)> A"));
- // Should be: with semicolon, without extra space in "> >"
+ // Should be: with semicolon
}
TEST(DeclPrinter, TestObjCMethod1) {