Skip to content

Commit 835b99e

Browse files
DoDoENTAaronBallman
authored andcommitted
Disambiguate type names when printing NTTP types
When printing NTTP template types, ensure that type name of the NTTP is printed. Fixes #57562 Differential Revision: https://reviews.llvm.org/D134453
1 parent 76cf890 commit 835b99e

File tree

8 files changed

+66
-64
lines changed

8 files changed

+66
-64
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ Improvements to Clang's diagnostics
336336
<https://clang.llvm.org/docs/ControlFlowIntegrity.html>`_ failures. This diagnostic
337337
is grouped under ``-Wcast-function-type`` as it identifies a more strict set of
338338
potentially problematic function type casts.
339+
- Clang will now disambiguate NTTP types when printing diagnostic that contain NTTP types.
340+
Fixes `Issue 57562 <https://github.com/llvm/llvm-project/issues/57562>`_.
339341

340342
Non-comprehensive list of changes in this release
341343
-------------------------------------------------

clang/lib/AST/TemplateBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ void TemplateArgument::print(const PrintingPolicy &Policy, raw_ostream &Out,
422422
}
423423

424424
case Declaration: {
425-
// FIXME: Include the type if it's not obvious from the context.
426425
NamedDecl *ND = getAsDecl();
427426
if (getParamTypeForDecl()->isRecordType()) {
428427
if (auto *TPO = dyn_cast<TemplateParamObjectDecl>(ND)) {
428+
TPO->getType().getUnqualifiedType().print(Out, Policy);
429429
TPO->printAsInit(Out, Policy);
430430
break;
431431
}

clang/test/CodeGenCXX/debug-info-template.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ template<ClassTemplateArg A> struct ClassTemplateArgTemplate {
165165
static constexpr const ClassTemplateArg &Arg = A;
166166
};
167167

168-
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ClassTemplateArgTemplate<{1, 2.000000e+00}>", {{.*}}, templateParams: ![[CLASS_TEMP_ARGS:[0-9]*]],
168+
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ClassTemplateArgTemplate<ClassTemplateArg{1, 2.000000e+00}>", {{.*}}, templateParams: ![[CLASS_TEMP_ARGS:[0-9]*]],
169169
// CHECK: ![[CLASS_TEMP_ARG_CONST_REF_TYPE:[0-9]*]] = !DIDerivedType(tag: DW_TAG_reference_type, baseType: ![[CLASS_TEMP_ARG_CONST_TYPE:[0-9]*]],
170170
// CHECK: ![[CLASS_TEMP_ARG_CONST_TYPE]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: ![[CLASS_TEMP_ARG_TYPE:[0-9]*]])
171171
// CHECK: ![[CLASS_TEMP_ARG_TYPE]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "ClassTemplateArg",
@@ -225,16 +225,16 @@ template void f1<t1 () volatile, t1 () const volatile, t1 () &, t1 () &&>();
225225
// CHECK-SAME: templateParams: ![[RAW_FUNC_QUAL_ARGS:[0-9]*]],
226226

227227
// CHECK: ![[RAW_FUNC_QUAL_ARGS]] = !{![[RAW_FUNC_QUAL_T1:[0-9]*]], ![[RAW_FUNC_QUAL_T2:[0-9]*]], ![[RAW_FUNC_QUAL_T3:[0-9]*]], ![[RAW_FUNC_QUAL_T4:[0-9]*]]}
228-
// CHECK: ![[RAW_FUNC_QUAL_T1]] = !DITemplateTypeParameter(name: "T1", type: ![[RAW_FUNC_QUAL_VOL:[0-9]*]])
228+
// CHECK: ![[RAW_FUNC_QUAL_T1]] = !DITemplateTypeParameter(name: "T1", type: ![[RAW_FUNC_QUAL_VOL:[0-9]*]])
229229
// CHECK: ![[RAW_FUNC_QUAL_VOL]] = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: ![[RAW_FUNC_QUAL_TYPE:[0-9]*]])
230230
// CHECK: ![[RAW_FUNC_QUAL_TYPE]] = !DISubroutineType(types: ![[RAW_FUNC_QUAL_LIST:[0-9]*]]
231231
// CHECK: ![[RAW_FUNC_QUAL_LIST]] = !{![[RAW_FUNC_QUAL_STRUCT:[0-9]*]]}
232232
// CHECK: ![[RAW_FUNC_QUAL_STRUCT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "t1"
233-
// CHECK: ![[RAW_FUNC_QUAL_T2]] = !DITemplateTypeParameter(name: "T2", type: ![[RAW_FUNC_QUAL_CNST:[0-9]*]])
233+
// CHECK: ![[RAW_FUNC_QUAL_T2]] = !DITemplateTypeParameter(name: "T2", type: ![[RAW_FUNC_QUAL_CNST:[0-9]*]])
234234
// CHECK: ![[RAW_FUNC_QUAL_CNST]] = !DIDerivedType(tag: DW_TAG_const_type, baseType: ![[RAW_FUNC_QUAL_TYPE:[0-9]*]])
235-
// CHECK: ![[RAW_FUNC_QUAL_T3]] = !DITemplateTypeParameter(name: "T3", type: ![[RAW_FUNC_QUAL_REF:[0-9]*]])
235+
// CHECK: ![[RAW_FUNC_QUAL_T3]] = !DITemplateTypeParameter(name: "T3", type: ![[RAW_FUNC_QUAL_REF:[0-9]*]])
236236
// CHECK: ![[RAW_FUNC_QUAL_REF]] = !DISubroutineType(flags: DIFlagLValueReference, types: ![[RAW_FUNC_QUAL_LIST]])
237-
// CHECK: ![[RAW_FUNC_QUAL_T4]] = !DITemplateTypeParameter(name: "T4", type: ![[RAW_FUNC_QUAL_REF_REF:[0-9]*]])
237+
// CHECK: ![[RAW_FUNC_QUAL_T4]] = !DITemplateTypeParameter(name: "T4", type: ![[RAW_FUNC_QUAL_REF_REF:[0-9]*]])
238238
// CHECK: ![[RAW_FUNC_QUAL_REF_REF]] = !DISubroutineType(flags: DIFlagRValueReference, types: ![[RAW_FUNC_QUAL_LIST]])
239239

240240
} // namespace RawFuncQual

clang/test/SemaCXX/cxx2a-nttp-printing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ void test_ascii() {
1616
" is too long">
1717
a;
1818
Foo(a); // expected-error {{no matching function}}
19-
decltype(a)::display(); // expected-error {{no member named 'display' in 'ASCII<{"this nontype template argument is [...]"}>'}}
19+
decltype(a)::display(); // expected-error {{no member named 'display' in 'ASCII<Str<43>{"this nontype template argument is [...]"}>'}}
2020
}
2121

2222
void test_non_ascii() {
2323
ASCII<"wait a s\033cond"> a;
2424
Bar(a); // expected-error {{no matching function}}
25-
decltype(a)::display(); // expected-error {{no member named 'display' in 'ASCII<{{119, 97, 105, 116, 32, 97, 32, 115, 27, 99, ...}}>'}}
25+
decltype(a)::display(); // expected-error {{no member named 'display' in 'ASCII<Str<14>{{119, 97, 105, 116, 32, 97, 32, 115, 27, 99, ...}}>'}}
2626
}
2727

2828
// The dialects (C++20 and above) that accept string literals as non-type
2929
// template arguments do not support trigraphs.
3030
void test_trigraph() {
3131
ASCII<"what??!"> a; // expected-warning {{trigraph ignored}}
3232
Meow(a); // expected-error {{no matching function}}
33-
decltype(a)::display(); // expected-error {{no member named 'display' in 'ASCII<{"what??!"}>'}}
33+
decltype(a)::display(); // expected-error {{no member named 'display' in 'ASCII<Str<8>{"what??!"}>'}}
3434
}

clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ namespace Diags {
186186
struct A { int n, m; };
187187
template<A a> struct X { static_assert(a.n == a.m); }; // expected-error {{static assertion failed due to requirement 'Diags::A{1, 2}.n == Diags::A{1, 2}.m'}} \
188188
// expected-note {{evaluates to '1 == 2'}}
189-
template struct X<A{1, 2}>; // expected-note {{in instantiation of template class 'Diags::X<{1, 2}>' requested here}}
189+
template struct X<A{1, 2}>; // expected-note {{in instantiation of template class 'Diags::X<A{1, 2}>' requested here}}
190190
}
191191

192192
namespace CTADPartialOrder {

clang/test/SemaTemplate/temp_arg_string_printing.cpp

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,111 +19,111 @@ struct Str {
1919
template <Str> class ASCII {};
2020

2121
void not_string() {
22-
// CHECK{LITERAL}: ASCII<{{9, -1, 42}}>
22+
// CHECK{LITERAL}: ASCII<Str<int, 3>{{9, -1, 42}}>
2323
new ASCII<(int[]){9, -1, 42}>;
24-
// CHECK{LITERAL}: ASCII<{{3.140000e+00, 0.000000e+00, 4.200000e+01}}>
24+
// CHECK{LITERAL}: ASCII<Str<double, 3>{{3.140000e+00, 0.000000e+00, 4.200000e+01}}>
2525
new ASCII<(double[]){3.14, 0., 42.}>;
2626
}
2727

2828
void narrow() {
29-
// CHECK{LITERAL}: ASCII<{""}>
29+
// CHECK{LITERAL}: ASCII<Str<char, 1>{""}>
3030
new ASCII<"">;
31-
// CHECK{LITERAL}: ASCII<{"the quick brown fox jumps"}>
31+
// CHECK{LITERAL}: ASCII<Str<char, 26>{"the quick brown fox jumps"}>
3232
new ASCII<"the quick brown fox jumps">;
33-
// CHECK{LITERAL}: ASCII<{"OVER THE LAZY DOG 0123456789"}>
33+
// CHECK{LITERAL}: ASCII<Str<char, 29>{"OVER THE LAZY DOG 0123456789"}>
3434
new ASCII<"OVER THE LAZY DOG 0123456789">;
35-
// CHECK{LITERAL}: ASCII<{"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
35+
// CHECK{LITERAL}: ASCII<Str<char, 33>{"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
3636
new ASCII<R"(\`~!@#$%^&*()_+-={}[]|'";:,.<>?/)">;
37-
// CHECK{LITERAL}: ASCII<{{101, 115, 99, 97, 112, 101, 0, 0}}>
37+
// CHECK{LITERAL}: ASCII<Str<char, 8>{{101, 115, 99, 97, 112, 101, 0, 0}}>
3838
new ASCII<"escape\0">;
39-
// CHECK{LITERAL}: ASCII<{"escape\r\n"}>
39+
// CHECK{LITERAL}: ASCII<Str<char, 9>{"escape\r\n"}>
4040
new ASCII<"escape\r\n">;
41-
// CHECK{LITERAL}: ASCII<{"escape\\\t\f\v"}>
41+
// CHECK{LITERAL}: ASCII<Str<char, 11>{"escape\\\t\f\v"}>
4242
new ASCII<"escape\\\t\f\v">;
43-
// CHECK{LITERAL}: ASCII<{"escape\a\bc"}>
43+
// CHECK{LITERAL}: ASCII<Str<char, 10>{"escape\a\bc"}>
4444
new ASCII<"escape\a\b\c">;
45-
// CHECK{LITERAL}: ASCII<{{110, 111, 116, 17, 0}}>
45+
// CHECK{LITERAL}: ASCII<Str<char, 5>{{110, 111, 116, 17, 0}}>
4646
new ASCII<"not\x11">;
47-
// CHECK{LITERAL}: ASCII<{{18, 20, 127, 16, 1, 32, 97, 98, 99, 0}}>
47+
// CHECK{LITERAL}: ASCII<Str<char, 10>{{18, 20, 127, 16, 1, 32, 97, 98, 99, 0}}>
4848
new ASCII<"\x12\x14\x7f\x10\x01 abc">;
49-
// CHECK{LITERAL}: ASCII<{{18, 20, 127, 16, 1, 32, 97, 98, 99, 100, 0}}>
49+
// CHECK{LITERAL}: ASCII<Str<char, 11>{{18, 20, 127, 16, 1, 32, 97, 98, 99, 100, 0}}>
5050
new ASCII<"\x12\x14\x7f\x10\x01 abcd">;
51-
// CHECK{LITERAL}: ASCII<{"print more characters as string"}>
51+
// CHECK{LITERAL}: ASCII<Str<char, 32>{"print more characters as string"}>
5252
new ASCII<"print more characters as string">;
53-
// CHECK{LITERAL}: ASCII<{"print more characters as string, no uplimit"}>
53+
// CHECK{LITERAL}: ASCII<Str<char, 44>{"print more characters as string, no uplimit"}>
5454
new ASCII<"print more characters as string, no uplimit">;
5555
}
5656

5757
void wide() {
58-
// CHECK{LITERAL}: ASCII<{L""}>
58+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 1>{L""}>
5959
new ASCII<L"">;
60-
// CHECK{LITERAL}: ASCII<{L"the quick brown fox jumps"}>
60+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 26>{L"the quick brown fox jumps"}>
6161
new ASCII<L"the quick brown fox jumps">;
62-
// CHECK{LITERAL}: ASCII<{L"OVER THE LAZY DOG 0123456789"}>
62+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 29>{L"OVER THE LAZY DOG 0123456789"}>
6363
new ASCII<L"OVER THE LAZY DOG 0123456789">;
64-
// CHECK{LITERAL}: ASCII<{L"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
64+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 33>{L"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
6565
new ASCII<LR"(\`~!@#$%^&*()_+-={}[]|'";:,.<>?/)">;
66-
// CHECK{LITERAL}: ASCII<{{101, 115, 99, 97, 112, 101, 0, 0}}>
66+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 8>{{101, 115, 99, 97, 112, 101, 0, 0}}>
6767
new ASCII<L"escape\0">;
68-
// CHECK{LITERAL}: ASCII<{L"escape\r\n"}>
68+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 9>{L"escape\r\n"}>
6969
new ASCII<L"escape\r\n">;
70-
// CHECK{LITERAL}: ASCII<{L"escape\\\t\f\v"}>
70+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 11>{L"escape\\\t\f\v"}>
7171
new ASCII<L"escape\\\t\f\v">;
72-
// CHECK{LITERAL}: ASCII<{L"escape\a\bc"}>
72+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 10>{L"escape\a\bc"}>
7373
new ASCII<L"escape\a\b\c">;
74-
// CHECK{LITERAL}: ASCII<{{110, 111, 116, 17, 0}}>
74+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 5>{{110, 111, 116, 17, 0}}>
7575
new ASCII<L"not\x11">;
76-
// CHECK{LITERAL}: ASCII<{{18, 20, 255, 22909, 136, 32, 97, 98, 99, 0}}>
76+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 10>{{18, 20, 255, 22909, 136, 32, 97, 98, 99, 0}}>
7777
new ASCII<L"\x12\x14\xff\x597d\x88 abc">;
78-
// CHECK{LITERAL}: ASCII<{{18, 20, 255, 22909, 136, 32, 97, 98, 99, 100, 0}}>
78+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 11>{{18, 20, 255, 22909, 136, 32, 97, 98, 99, 100, 0}}>
7979
new ASCII<L"\x12\x14\xff\x597d\x88 abcd">;
80-
// CHECK{LITERAL}: ASCII<{L"print more characters as string"}>
80+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 32>{L"print more characters as string"}>
8181
new ASCII<L"print more characters as string">;
82-
// CHECK{LITERAL}: ASCII<{L"print more characters as string, no uplimit"}>
82+
// CHECK{LITERAL}: ASCII<Str<wchar_t, 44>{L"print more characters as string, no uplimit"}>
8383
new ASCII<L"print more characters as string, no uplimit">;
8484
}
8585

8686
void utf8() {
87-
// CHECK{LITERAL}: ASCII<{u8""}>
87+
// CHECK{LITERAL}: ASCII<Str<char8_t, 1>{u8""}>
8888
new ASCII<u8"">;
89-
// CHECK{LITERAL}: ASCII<{u8"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
89+
// CHECK{LITERAL}: ASCII<Str<char8_t, 33>{u8"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
9090
new ASCII<u8R"(\`~!@#$%^&*()_+-={}[]|'";:,.<>?/)">;
91-
// CHECK{LITERAL}: ASCII<{{101, 115, 99, 97, 112, 101, 0, 0}}>
91+
// CHECK{LITERAL}: ASCII<Str<char8_t, 8>{{101, 115, 99, 97, 112, 101, 0, 0}}>
9292
new ASCII<u8"escape\0">;
93-
// CHECK{LITERAL}: ASCII<{u8"escape\r\n"}>
93+
// CHECK{LITERAL}: ASCII<Str<char8_t, 9>{u8"escape\r\n"}>
9494
new ASCII<u8"escape\r\n">;
95-
// CHECK{LITERAL}: ASCII<{{229, 165, 189, 239, 191, 189, 0}}>
95+
// CHECK{LITERAL}: ASCII<Str<char8_t, 7>{{229, 165, 189, 239, 191, 189, 0}}>
9696
new ASCII<u8"\u597d\ufffd">;
97-
// CHECK{LITERAL}: ASCII<{u8"print more characters as string, no uplimit"}>
97+
// CHECK{LITERAL}: ASCII<Str<char8_t, 44>{u8"print more characters as string, no uplimit"}>
9898
new ASCII<u8"print more characters as string, no uplimit">;
9999
}
100100

101101
void utf16() {
102-
// CHECK{LITERAL}: ASCII<{u""}>
102+
// CHECK{LITERAL}: ASCII<Str<char16_t, 1>{u""}>
103103
new ASCII<u"">;
104-
// CHECK{LITERAL}: ASCII<{u"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
104+
// CHECK{LITERAL}: ASCII<Str<char16_t, 33>{u"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
105105
new ASCII<uR"(\`~!@#$%^&*()_+-={}[]|'";:,.<>?/)">;
106-
// CHECK{LITERAL}: ASCII<{{101, 115, 99, 97, 112, 101, 0, 0}}>
106+
// CHECK{LITERAL}: ASCII<Str<char16_t, 8>{{101, 115, 99, 97, 112, 101, 0, 0}}>
107107
new ASCII<u"escape\0">;
108-
// CHECK{LITERAL}: ASCII<{u"escape\r\n"}>
108+
// CHECK{LITERAL}: ASCII<Str<char16_t, 9>{u"escape\r\n"}>
109109
new ASCII<u"escape\r\n">;
110-
// CHECK{LITERAL}: ASCII<{{22909, 65533, 0}}>
110+
// CHECK{LITERAL}: ASCII<Str<char16_t, 3>{{22909, 65533, 0}}>
111111
new ASCII<u"\u597d\ufffd">;
112-
// CHECK{LITERAL}: ASCII<{u"print more characters as string, no uplimit"}>
112+
// CHECK{LITERAL}: ASCII<Str<char16_t, 44>{u"print more characters as string, no uplimit"}>
113113
new ASCII<u"print more characters as string, no uplimit">;
114114
}
115115

116116
void utf32() {
117-
// CHECK{LITERAL}: ASCII<{U""}>
117+
// CHECK{LITERAL}: ASCII<Str<char32_t, 1>{U""}>
118118
new ASCII<U"">;
119-
// CHECK{LITERAL}: ASCII<{U"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
119+
// CHECK{LITERAL}: ASCII<Str<char32_t, 33>{U"\\`~!@#$%^&*()_+-={}[]|\'\";:,.<>?/"}>
120120
new ASCII<UR"(\`~!@#$%^&*()_+-={}[]|'";:,.<>?/)">;
121-
// CHECK{LITERAL}: ASCII<{{101, 115, 99, 97, 112, 101, 0, 0}}>
121+
// CHECK{LITERAL}: ASCII<Str<char32_t, 8>{{101, 115, 99, 97, 112, 101, 0, 0}}>
122122
new ASCII<U"escape\0">;
123-
// CHECK{LITERAL}: ASCII<{U"escape\r\n"}>
123+
// CHECK{LITERAL}: ASCII<Str<char32_t, 9>{U"escape\r\n"}>
124124
new ASCII<U"escape\r\n">;
125-
// CHECK{LITERAL}: ASCII<{{22909, 131358, 0}}>
125+
// CHECK{LITERAL}: ASCII<Str<char32_t, 3>{{22909, 131358, 0}}>
126126
new ASCII<U"\u597d\U0002011E">;
127-
// CHECK{LITERAL}: ASCII<{U"print more characters as string, no uplimit"}>
127+
// CHECK{LITERAL}: ASCII<Str<char32_t, 44>{U"print more characters as string, no uplimit"}>
128128
new ASCII<U"print more characters as string, no uplimit">;
129129
}

clang/unittests/AST/StmtPrinterTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ TEST(StmtPrinter, TestStringLiteralOperatorTemplate_Pack) {
161161
}
162162

163163
TEST(StmtPrinter, TestStringLiteralOperatorTemplate_Class) {
164-
ASSERT_TRUE(
165-
PrintedStmtCXXMatches(StdVer::CXX20,
166-
R"cpp(
164+
ASSERT_TRUE(PrintedStmtCXXMatches(
165+
StdVer::CXX20,
166+
R"cpp(
167167
struct C {
168168
template <unsigned N> constexpr C(const char (&)[N]) : n(N) {}
169169
unsigned n;
@@ -173,8 +173,8 @@ TEST(StmtPrinter, TestStringLiteralOperatorTemplate_Class) {
173173
constexpr auto waldo = "abc"_c;
174174
}
175175
)cpp",
176-
FunctionBodyMatcher("A"),
177-
"constexpr auto waldo = operator\"\"_c<{4}>();\n"));
176+
FunctionBodyMatcher("A"),
177+
"constexpr auto waldo = operator\"\"_c<C{4}>();\n"));
178178
}
179179

180180
TEST(StmtPrinter, TestCXXConversionDeclImplicit) {

clang/unittests/AST/TypePrinterTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ TEST(TypePrinter, TemplateId) {
4848
std::string Code = R"cpp(
4949
namespace N {
5050
template <typename> struct Type {};
51-
51+
5252
template <typename T>
5353
void Foo(const Type<T> &Param);
5454
}
@@ -115,14 +115,14 @@ TEST(TypePrinter, TemplateIdWithNTTP) {
115115

116116
ASSERT_TRUE(PrintedTypeMatches(
117117
Code, {"-std=c++20"}, Matcher,
118-
R"(ASCII<{"this nontype template argument is [...]"}> &&)",
118+
R"(ASCII<Str<52>{"this nontype template argument is [...]"}> &&)",
119119
[](PrintingPolicy &Policy) {
120120
Policy.EntireContentsOfLargeArray = false;
121121
}));
122122

123123
ASSERT_TRUE(PrintedTypeMatches(
124124
Code, {"-std=c++20"}, Matcher,
125-
R"(ASCII<{"this nontype template argument is too long to print"}> &&)",
125+
R"(ASCII<Str<52>{"this nontype template argument is too long to print"}> &&)",
126126
[](PrintingPolicy &Policy) {
127127
Policy.EntireContentsOfLargeArray = true;
128128
}));

0 commit comments

Comments
 (0)