compilerplugins/clang/test/unnecessaryoverride-dtor.hxx | 4 ++++ compilerplugins/clang/unnecessaryoverride.cxx | 4 ++++ 2 files changed, 8 insertions(+)
New commits: commit f2b4d849715b5dfcbaf422846327fd41d3576ba1 Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Mar 13 14:22:08 2017 +0100 Fix loplugin:unnecessaryoverride (user-provided virtual dtor in class with dependent base) Change-Id: I37b3cc3d32e76a0286ecc91f999920e3dfe706cc diff --git a/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx b/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx index 81733a9..e26024b 100644 --- a/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx +++ b/compilerplugins/clang/test/unnecessaryoverride-dtor.hxx @@ -46,6 +46,10 @@ struct MarkedInlineButNotDefined { inline ~MarkedInlineButNotDefined(); }; +template<typename T> struct TemplateBase: T { + virtual ~TemplateBase() {} +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/compilerplugins/clang/unnecessaryoverride.cxx b/compilerplugins/clang/unnecessaryoverride.cxx index 8cf811b..166ae65 100644 --- a/compilerplugins/clang/unnecessaryoverride.cxx +++ b/compilerplugins/clang/unnecessaryoverride.cxx @@ -143,6 +143,10 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) return true; } } + else + { + return true; // dependent base + } } } // corner case _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits