File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -288,11 +288,35 @@ struct DumpSymbols {
288
288
if (symbol->isConstinit ()) out << " constinit" ;
289
289
if (symbol->isInline ()) out << " inline" ;
290
290
291
- out << std::format (" {}\n " , to_string (symbol->type (), symbol->name ()));
291
+ out << std::format (" {}" , to_string (symbol->type (), symbol->name ()));
292
+
293
+ if (!symbol->templateArguments ().empty ()) {
294
+ out << " <" ;
295
+ std::string_view sep = " " ;
296
+ for (auto arg : symbol->templateArguments ()) {
297
+ auto symbol = std::get_if<Symbol*>(&arg);
298
+ if (!symbol) continue ;
299
+ auto sym = *symbol;
300
+ if (sym->isTypeAlias ()) {
301
+ out << std::format (" {}{}" , sep, to_string (sym->type ()));
302
+ } else if (auto var = symbol_cast<VariableSymbol>(sym)) {
303
+ auto cst = std::get<std::intmax_t >(var->constValue ().value ());
304
+ out << std::format (" {}{}" , sep, cst);
305
+ } else {
306
+ cxx_runtime_error (" todo" );
307
+ }
308
+ sep = " , " ;
309
+ }
310
+ out << std::format (" >" );
311
+ }
312
+
313
+ out << " \n " ;
292
314
293
315
if (symbol->templateParameters ()) {
294
316
dumpScope (symbol->templateParameters ());
295
317
}
318
+
319
+ dumpSpecializations (symbol->specializations ());
296
320
}
297
321
298
322
void operator ()(FieldSymbol* symbol) {
Original file line number Diff line number Diff line change @@ -6,3 +6,12 @@ constexpr bool is_integral_v = __is_integral(T);
6
6
static_assert (is_integral_v<int >);
7
7
static_assert (is_integral_v<char >);
8
8
static_assert (is_integral_v<void *> == false );
9
+
10
+ // clang-format off
11
+ // CHECK:namespace
12
+ // CHECK-NEXT: template variable constexpr const bool is_integral_v
13
+ // CHECK-NEXT: parameter typename<0, 0> T
14
+ // CHECK-NEXT: [specializations]
15
+ // CHECK-NEXT: variable constexpr bool is_integral_v<int>
16
+ // CHECK-NEXT: variable constexpr bool is_integral_v<char>
17
+ // CHECK-NEXT: variable constexpr bool is_integral_v<void*>
You can’t perform that action at this time.
0 commit comments