[Libreoffice-commits] core.git: compilerplugins/clang
Stephan Bergmann
sbergman at redhat.com
Mon Mar 13 13:22:57 UTC 2017
compilerplugins/clang/test/unnecessaryoverride-dtor.hxx | 4 ++++
compilerplugins/clang/unnecessaryoverride.cxx | 4 ++++
2 files changed, 8 insertions(+)
New commits:
commit f2b4d849715b5dfcbaf422846327fd41d3576ba1
Author: Stephan Bergmann <sbergman at 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
More information about the Libreoffice-commits
mailing list