[cfe-dev] Strange error in a very simple PreCall checker
Saheel Godhane
srgodhane at ucdavis.edu
Sun Feb 15 23:36:50 PST 2015
Hello everyone,
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. :(
---------------------------------------------------------------------------------------------------------
#include "ClangSACheckers.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
using namespace clang;
using namespace ento;
namespace {
class MyChecker : public Checker< check::PreCall > {
public:
void checkPreCall(const CallEvent &Call, CheckerContext &C) const {
*SourceManager source_mgr = C.getSourceManager();*
}
};
}
void ento::registerMyChecker(CheckerManager &mgr) {
mgr.registerChecker<MyChecker>();
}
---------------------------------------------------------------------------------------------------------
Error: no matching function for call to
‘clang::SourceManager::SourceManager(clang::SourceManager&)’
SourceManager source_mgr = C.getSourceManager();
candidate is:
clang::SourceManager::SourceManager(clang::DiagnosticsEngine&,
clang::FileManager&, bool)
SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr,
^
---------------------------------------------------------------------------------------------------------
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?
Any help will be greatly appreciated!
Sincerely,
Saheel.
(PhD student from UC Davis)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150215/d86104ea/attachment.html>
More information about the cfe-dev
mailing list