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 {
288288 if  (symbol->isConstinit ()) out << "  constinit"  ;
289289 if  (symbol->isInline ()) out << "  inline"  ;
290290
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 "  ;
292314
293315 if  (symbol->templateParameters ()) {
294316 dumpScope (symbol->templateParameters ());
295317 }
318+ 
319+  dumpSpecializations (symbol->specializations ());
296320 }
297321
298322 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);
66static_assert (is_integral_v<int >);
77static_assert (is_integral_v<char >);
88static_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