summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST/DeclPrinterTest.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-23 03:17:06 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-23 03:17:06 +0000
commita4bb292095482300a74170e4e297055549a38736 (patch)
treed464e0811f4a05adffcc1ac39e868cb34fd27493 /clang/unittests/AST/DeclPrinterTest.cpp
parentf98b00c33e83cb507c21107e8c56961a4b043509 (diff)
downloadbcm5719-llvm-a4bb292095482300a74170e4e297055549a38736.tar.gz
bcm5719-llvm-a4bb292095482300a74170e4e297055549a38736.zip
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
Diffstat (limited to 'clang/unittests/AST/DeclPrinterTest.cpp')
-rw-r--r--clang/unittests/AST/DeclPrinterTest.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp
index 5340756c03d..9ba597994bc 100644
--- a/clang/unittests/AST/DeclPrinterTest.cpp
+++ b/clang/unittests/AST/DeclPrinterTest.cpp
@@ -544,6 +544,7 @@ TEST(DeclPrinter, TestCXXConstructorDecl10) {
"};",
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 @@ TEST(DeclPrinter, TestCXXConstructorDecl11) {
" 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 @@ TEST(DeclPrinter, TestClassTemplateDecl10) {
"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 @@ TEST(DeclPrinter, TestClassTemplateDecl11) {
"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 @@ TEST(DeclPrinter, TestFunctionTemplateDecl3) {
"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 @@ TEST(DeclPrinter, TestTemplateArgumentList13) {
"};",
"A",
"Z<T...> A"));
- // Should be: with semicolon, without extra space in "> >"
+ // Should be: with semicolon
}
TEST(DeclPrinter, TestTemplateArgumentList14) {
@@ -1251,7 +1250,7 @@ TEST(DeclPrinter, TestTemplateArgumentList14) {
"};",
"A",
"Z<Y<T>...> A"));
- // Should be: with semicolon, without extra space in "> >"
+ // Should be: with semicolon
}
TEST(DeclPrinter, TestTemplateArgumentList15) {
@@ -1262,7 +1261,7 @@ TEST(DeclPrinter, TestTemplateArgumentList15) {
"};",
"A",
"Z<sizeof...(T)> A"));
- // Should be: with semicolon, without extra space in "> >"
+ // Should be: with semicolon
}
TEST(DeclPrinter, TestObjCMethod1) {
OpenPOWER on IntegriCloud