Skip to content

Commit 64f170c

Browse files
committed
[clang][NFC] Format DeclPrinterTest partially
Only TestClassTemplateDecl* tests have been formatted because TestClassTemplateDecl9 is affected in llvm#162134, and because clang-format makes the code worse for some other test cases.
1 parent 2121bda commit 64f170c

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

clang/unittests/AST/DeclPrinterTest.cpp

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,91 +1022,91 @@ TEST(DeclPrinter, TestFieldDecl2) {
10221022
}
10231023

10241024
TEST(DeclPrinter, TestClassTemplateDecl1) {
1025-
ASSERT_TRUE(PrintedDeclCXX98Matches(
1026-
"template<typename T>"
1027-
"struct A { T a; };",
1028-
classTemplateDecl(hasName("A")).bind("id"),
1029-
"template <typename T> struct A {}"));
1025+
ASSERT_TRUE(
1026+
PrintedDeclCXX98Matches("template<typename T>"
1027+
"struct A { T a; };",
1028+
classTemplateDecl(hasName("A")).bind("id"),
1029+
"template <typename T> struct A {}"));
10301030
}
10311031

10321032
TEST(DeclPrinter, TestClassTemplateDecl2) {
1033-
ASSERT_TRUE(PrintedDeclCXX98Matches(
1034-
"template<typename T = int>"
1035-
"struct A { T a; };",
1036-
classTemplateDecl(hasName("A")).bind("id"),
1037-
"template <typename T = int> struct A {}"));
1033+
ASSERT_TRUE(
1034+
PrintedDeclCXX98Matches("template<typename T = int>"
1035+
"struct A { T a; };",
1036+
classTemplateDecl(hasName("A")).bind("id"),
1037+
"template <typename T = int> struct A {}"));
10381038
}
10391039

10401040
TEST(DeclPrinter, TestClassTemplateDecl3) {
1041-
ASSERT_TRUE(PrintedDeclCXX98Matches(
1042-
"template<class T>"
1043-
"struct A { T a; };",
1044-
classTemplateDecl(hasName("A")).bind("id"),
1045-
"template <class T> struct A {}"));
1041+
ASSERT_TRUE(
1042+
PrintedDeclCXX98Matches("template<class T>"
1043+
"struct A { T a; };",
1044+
classTemplateDecl(hasName("A")).bind("id"),
1045+
"template <class T> struct A {}"));
10461046
}
10471047

10481048
TEST(DeclPrinter, TestClassTemplateDecl4) {
1049-
ASSERT_TRUE(PrintedDeclCXX98Matches(
1050-
"template<typename T, typename U>"
1051-
"struct A { T a; U b; };",
1052-
classTemplateDecl(hasName("A")).bind("id"),
1053-
"template <typename T, typename U> struct A {}"));
1049+
ASSERT_TRUE(
1050+
PrintedDeclCXX98Matches("template<typename T, typename U>"
1051+
"struct A { T a; U b; };",
1052+
classTemplateDecl(hasName("A")).bind("id"),
1053+
"template <typename T, typename U> struct A {}"));
10541054
}
10551055

10561056
TEST(DeclPrinter, TestClassTemplateDecl5) {
1057-
ASSERT_TRUE(PrintedDeclCXX98Matches(
1058-
"template<int N>"
1059-
"struct A { int a[N]; };",
1060-
classTemplateDecl(hasName("A")).bind("id"),
1061-
"template <int N> struct A {}"));
1057+
ASSERT_TRUE(
1058+
PrintedDeclCXX98Matches("template<int N>"
1059+
"struct A { int a[N]; };",
1060+
classTemplateDecl(hasName("A")).bind("id"),
1061+
"template <int N> struct A {}"));
10621062
}
10631063

10641064
TEST(DeclPrinter, TestClassTemplateDecl6) {
1065-
ASSERT_TRUE(PrintedDeclCXX98Matches(
1066-
"template<int N = 42>"
1067-
"struct A { int a[N]; };",
1068-
classTemplateDecl(hasName("A")).bind("id"),
1069-
"template <int N = 42> struct A {}"));
1065+
ASSERT_TRUE(
1066+
PrintedDeclCXX98Matches("template<int N = 42>"
1067+
"struct A { int a[N]; };",
1068+
classTemplateDecl(hasName("A")).bind("id"),
1069+
"template <int N = 42> struct A {}"));
10701070
}
10711071

10721072
TEST(DeclPrinter, TestClassTemplateDecl7) {
1073-
ASSERT_TRUE(PrintedDeclCXX98Matches(
1074-
"typedef int MyInt;"
1075-
"template<MyInt N>"
1076-
"struct A { int a[N]; };",
1077-
classTemplateDecl(hasName("A")).bind("id"),
1078-
"template <MyInt N> struct A {}"));
1073+
ASSERT_TRUE(
1074+
PrintedDeclCXX98Matches("typedef int MyInt;"
1075+
"template<MyInt N>"
1076+
"struct A { int a[N]; };",
1077+
classTemplateDecl(hasName("A")).bind("id"),
1078+
"template <MyInt N> struct A {}"));
10791079
}
10801080

10811081
TEST(DeclPrinter, TestClassTemplateDecl8) {
10821082
ASSERT_TRUE(PrintedDeclCXX98Matches(
1083-
"template<template<typename U> class T> struct A { };",
1084-
classTemplateDecl(hasName("A")).bind("id"),
1085-
"template <template <typename U> class T> struct A {}"));
1083+
"template<template<typename U> class T> struct A { };",
1084+
classTemplateDecl(hasName("A")).bind("id"),
1085+
"template <template <typename U> class T> struct A {}"));
10861086
}
10871087

10881088
TEST(DeclPrinter, TestClassTemplateDecl9) {
10891089
ASSERT_TRUE(PrintedDeclCXX98Matches(
1090-
"template<typename T> struct Z { };"
1091-
"template<template<typename U> class T = Z> struct A { };",
1092-
classTemplateDecl(hasName("A")).bind("id"),
1093-
"template <template <typename U> class T> struct A {}"));
1090+
"template<typename T> struct Z { };"
1091+
"template<template<typename U> class T = Z> struct A { };",
1092+
classTemplateDecl(hasName("A")).bind("id"),
1093+
"template <template <typename U> class T> struct A {}"));
10941094
}
10951095

10961096
TEST(DeclPrinter, TestClassTemplateDecl10) {
1097-
ASSERT_TRUE(PrintedDeclCXX11Matches(
1098-
"template<typename... T>"
1099-
"struct A { int a; };",
1100-
classTemplateDecl(hasName("A")).bind("id"),
1101-
"template <typename ...T> struct A {}"));
1097+
ASSERT_TRUE(
1098+
PrintedDeclCXX11Matches("template<typename... T>"
1099+
"struct A { int a; };",
1100+
classTemplateDecl(hasName("A")).bind("id"),
1101+
"template <typename ...T> struct A {}"));
11021102
}
11031103

11041104
TEST(DeclPrinter, TestClassTemplateDecl11) {
11051105
ASSERT_TRUE(PrintedDeclCXX11Matches(
1106-
"template<typename... T>"
1107-
"struct A : public T... { int a; };",
1108-
classTemplateDecl(hasName("A")).bind("id"),
1109-
"template <typename ...T> struct A : public T... {}"));
1106+
"template<typename... T>"
1107+
"struct A : public T... { int a; };",
1108+
classTemplateDecl(hasName("A")).bind("id"),
1109+
"template <typename ...T> struct A : public T... {}"));
11101110
}
11111111

11121112
TEST(DeclPrinter, TestClassTemplatePartialSpecializationDecl1) {

0 commit comments

Comments
 (0)