diff options
Diffstat (limited to 'compilerplugins/clang/fragiledestructor.cxx')
-rw-r--r-- | compilerplugins/clang/fragiledestructor.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compilerplugins/clang/fragiledestructor.cxx b/compilerplugins/clang/fragiledestructor.cxx index c9f8568fdafd..777710056684 100644 --- a/compilerplugins/clang/fragiledestructor.cxx +++ b/compilerplugins/clang/fragiledestructor.cxx @@ -12,7 +12,7 @@ #include <iostream> #include "plugin.hxx" -#include "compat.hxx" +#include "config_clang.h" #include "clang/AST/CXXInheritance.h" @@ -51,8 +51,6 @@ public: return false; if (loplugin::isSamePathname(fn, SRCDIR "/sw/source/core/layout/ssfrm.cxx")) // ~SwFrame calling IsDeleteForbidden return false; - if (loplugin::isSamePathname(fn, SRCDIR "/chart2/source/model/template/CandleStickChartType.cxx")) // to ignore <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100797> "[10/11/12 Regression] using declaration causing virtual call with wrongly adjusted this pointer" workaround - return false; return true; } @@ -113,8 +111,8 @@ bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr return true; // if we see an explicit call to its own method, that's OK - auto s1 = compiler.getSourceManager().getCharacterData(compat::getBeginLoc(callExpr)); - auto s2 = compiler.getSourceManager().getCharacterData(compat::getEndLoc(callExpr)); + auto s1 = compiler.getSourceManager().getCharacterData(callExpr->getBeginLoc()); + auto s2 = compiler.getSourceManager().getCharacterData(callExpr->getEndLoc()); std::string tok(s1, s2-s1); if (tok.find("::") != std::string::npos) return true; @@ -127,12 +125,12 @@ bool FragileDestructor::VisitCXXMemberCallExpr(const CXXMemberCallExpr* callExpr report( DiagnosticsEngine::Warning, "calling virtual method from destructor, either make the virtual method final, or make this class final", - compat::getBeginLoc(callExpr)) + callExpr->getBeginLoc()) << callExpr->getSourceRange(); report( DiagnosticsEngine::Note, "callee method here", - compat::getBeginLoc(methodDecl)) + methodDecl->getBeginLoc()) << methodDecl->getSourceRange(); return true; } |