diff options
Diffstat (limited to 'compilerplugins/clang/override.cxx')
-rw-r--r-- | compilerplugins/clang/override.cxx | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/compilerplugins/clang/override.cxx b/compilerplugins/clang/override.cxx index a350415e36d6..412846c5b521 100644 --- a/compilerplugins/clang/override.cxx +++ b/compilerplugins/clang/override.cxx @@ -54,24 +54,6 @@ bool Override::VisitCXXMethodDecl(CXXMethodDecl const * decl) { { return true; } - // It appears that the C++ standard allows overriding destructors to be - // marked "override," but at least some MSVC versions complain about it, so - // at least make sure such destructors are explicitly marked "virtual": - if (isa<CXXDestructorDecl>(decl)) { - if (!decl->isVirtualAsWritten() - && (rewriter == nullptr - || !insertTextBefore( - decl->getSourceRange().getBegin(), "virtual "))) - { - report( - DiagnosticsEngine::Warning, - ("overriding destructor declaration not explicitly marked" - " 'override'"), - decl->getLocation()) - << decl->getSourceRange(); - } - return true; - } std::string over( isInUnoIncludeFile(decl->getSourceRange().getBegin()) ? "SAL_OVERRIDE" : "override"); @@ -148,7 +130,8 @@ bool Override::VisitCXXMethodDecl(CXXMethodDecl const * decl) { l, &l)) { n = Lexer::MeasureTokenLength( - l, compiler.getSourceManager(), compiler.getLangOpts()); + compiler.getSourceManager().getSpellingLoc(l), + compiler.getSourceManager(), compiler.getLangOpts()); } l = l.getLocWithOffset(std::max<unsigned>(n, 1)); } |