<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>In a Static Analyzer checker, using AST matchers, I located an IntegerLiteral that I want to report. I'm trying to do this with BugReporter::EmitBasicReport, which requires a PathDiagnosticLocation.<br>
<br></div>There is PathDiagnosticLocation::createBegin that I've used before with previous checkers - unfortunately, the overload that accepts an Stmt* (as an IntegerLiteral is not a Decl, but it is an Stmt) also requires a mysterious third parameter, a LocationOrAnalysisDeclContext. I tried looking through the documentation, but apparently anything that returns a LocationDeclContext or AnalysisDeclContext either require a CheckerContext (which I don't have, because I'm in checkEndOfTranslationUnit: all I have is the TranslationUnitDecl, the AnalysisManager and the BugReporter), or a Decl*.<br>
<br></div>Any clues on how could I do this? I'm using Clang 3.2.<br><br></div>Note: I'm aware that the Clang Static Analyzer by default is not linked to libASTMatchers, but I solved that, that is NOT the issue here.<br>
<br></div>Thanks!<br><br>Gabor<br></div>