File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed
Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -958,20 +958,25 @@ namespace Cpp {
958958 return " <unknown>" ;
959959
960960 auto *D = (clang::Decl *) func;
961- if (auto *FD = llvm::dyn_cast<FunctionDecl>(D)) {
962- std::string Signature;
963- raw_string_ostream SS (Signature);
964- PrintingPolicy Policy = getASTContext ().getPrintingPolicy ();
965- // Skip printing the body
966- Policy.TerseOutput = true ;
967- Policy.FullyQualifiedName = true ;
968- Policy.SuppressDefaultTemplateArgs = false ;
969- FD->print (SS, Policy);
970- SS.flush ();
971- return Signature;
972- }
961+ clang::FunctionDecl* FD;
962+
963+ if (llvm::dyn_cast<FunctionDecl>(D))
964+ FD = llvm::dyn_cast<FunctionDecl>(D);
965+ else if (auto * FTD = llvm::dyn_cast<clang::FunctionTemplateDecl>(D))
966+ FD = FTD->getTemplatedDecl ();
967+ else
968+ return " <unknown>" ;
973969
974- return " <unknown>" ;
970+ std::string Signature;
971+ raw_string_ostream SS (Signature);
972+ PrintingPolicy Policy = getASTContext ().getPrintingPolicy ();
973+ // Skip printing the body
974+ Policy.TerseOutput = true ;
975+ Policy.FullyQualifiedName = true ;
976+ Policy.SuppressDefaultTemplateArgs = false ;
977+ FD->print (SS, Policy);
978+ SS.flush ();
979+ return Signature;
975980 }
976981
977982 // Internal functions that are not needed outside the library are
You can’t perform that action at this time.
0 commit comments