46 const auto *
FuncDecl = Result.Nodes.getNodeAs<FunctionDecl>(
"func_decl");
52 SourceLocation SrcBegin =
FuncDecl->getBeginLoc();
56 if (
const TemplateParameterList *TemplateParams =
58 SrcBegin = TemplateParams->getRAngleLoc();
59 std::optional<Token> NextToken =
61 SrcBegin, *Result.SourceManager, Result.Context->getLangOpts());
63 SrcBegin = NextToken->getLocation();
68 getHeaderFileExtensions()))
72 if (
const auto *MethodDecl = dyn_cast<CXXMethodDecl>(
FuncDecl))
73 if (MethodDecl->getParent()->isLambda())
77 auto Loc = FullSourceLoc(Result.SourceManager->getFileLoc(SrcBegin),
78 *Result.SourceManager);
79 const StringRef SrcText = Loc.getBufferData().drop_front(Loc.getFileOffset());
80 if (SrcText.starts_with(
"LIBC_INLINE"))
83 diag(SrcBegin,
"%0 must be tagged with the LIBC_INLINE macro; the macro "
84 "should be placed at the beginning of the declaration")
85 <<
FuncDecl << FixItHint::CreateInsertion(Loc,
"LIBC_INLINE ");
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.