<div dir="ltr">Hello everyone,<div><br></div><div>I am getting an error while writing a very simple checker. Can someone please help me out with this? Here's my code. The bold line throws an error (given below the code). I am completely out of wits with this one. :(</div><div>---------------------------------------------------------------------------------------------------------<br></div><div><div>#include "ClangSACheckers.h"</div><div>#include "clang/StaticAnalyzer/Core/Checker.h"</div><div>#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"</div><div><br></div><div>using namespace clang;</div><div>using namespace ento;</div><div><br></div><div>namespace {</div><div>class MyChecker : public Checker< check::PreCall > {</div><div>public:</div><div>    void checkPreCall(const CallEvent &Call, CheckerContext &C) const {</div><div>    <b>SourceManager source_mgr = C.getSourceManager();</b></div><div>    }</div><div>};</div><div>}</div><div><br></div><div>void ento::registerMyChecker(CheckerManager &mgr) {</div><div>  mgr.registerChecker<MyChecker>();</div><div>}</div></div><div>---------------------------------------------------------------------------------------------------------</div><div><div>Error: no matching function for call to ‘clang::SourceManager::SourceManager(clang::SourceManager&)’</div><div>     SourceManager source_mgr = C.getSourceManager();</div></div><div>candidate is:</div><div><div>clang::SourceManager::SourceManager(clang::DiagnosticsEngine&, clang::FileManager&, bool)</div><div>   SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr,</div><div>   ^</div></div><div>---------------------------------------------------------------------------------------------------------<br></div><div>I am not even understanding why it is trying to call the constructor for SourceManager. I registered and tried to compile this checker like any other checker. Is there something about a PreCall checker that I am missing?</div><div><br></div><div>Any help will be greatly appreciated!</div><div><br></div><div>Sincerely,</div><div>Saheel.</div><div>(PhD student from UC Davis)</div></div>