21 const TemplateParameterList *ReturnList =
22 FuncDecl->getDescribedTemplateParams();
25 const unsigned NumberOfTemplateParameterLists =
26 FuncDecl->getNumTemplateParameterLists();
28 if (NumberOfTemplateParameterLists > 0)
29 ReturnList =
FuncDecl->getTemplateParameterList(
30 NumberOfTemplateParameterLists - 1);
48 const auto *
FuncDecl = Result.Nodes.getNodeAs<FunctionDecl>(
"func_decl");
54 SourceLocation SrcBegin =
FuncDecl->getBeginLoc();
58 if (
const TemplateParameterList *TemplateParams =
60 SrcBegin = TemplateParams->getRAngleLoc();
61 std::optional<Token> NextToken =
63 SrcBegin, *Result.SourceManager, Result.Context->getLangOpts());
65 SrcBegin = NextToken->getLocation();
70 HeaderFileExtensions))
74 if (
const auto *MethodDecl = dyn_cast<CXXMethodDecl>(
FuncDecl))
75 if (MethodDecl->getParent()->isLambda())
79 auto Loc = FullSourceLoc(Result.SourceManager->getFileLoc(SrcBegin),
80 *Result.SourceManager);
81 llvm::StringRef SrcText = Loc.getBufferData().drop_front(Loc.getFileOffset());
82 if (SrcText.starts_with(
"LIBC_INLINE"))
85 diag(SrcBegin,
"%0 must be tagged with the LIBC_INLINE macro; the macro "
86 "should be placed at the beginning of the declaration")
87 <<
FuncDecl << FixItHint::CreateInsertion(Loc,
"LIBC_INLINE ");
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.