From 9f4f237a3834e5d58a87296424db5428f68d1550 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 17 Jul 2015 13:08:16 +0200 Subject: loplugin:unusedmethods svl Change-Id: If86cc43fda4d138cf7f678d81fa2b35f68f3c03b Reviewed-on: https://gerrit.libreoffice.org/17162 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- compilerplugins/clang/unusedmethods.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'compilerplugins/clang/unusedmethods.cxx') diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx index a137a216cfc6..6627fe90a0cc 100644 --- a/compilerplugins/clang/unusedmethods.cxx +++ b/compilerplugins/clang/unusedmethods.cxx @@ -124,12 +124,19 @@ static bool startsWith(const std::string& s, const char* other) return s.compare(0, strlen(other), other) == 0; } -static bool isStandardStuff(const std::string& s) +static bool isStandardStuff(const std::string& input) { + std::string s = input; + if (startsWith(s,"class ")) + s = s.substr(6); + else if (startsWith(s,"struct ")) + s = s.substr(7); // ignore UNO interface definitions, cannot change those return startsWith(s, "com::sun::star::") // ignore stuff in the C++ stdlib and boost || startsWith(s, "std::") || startsWith(s, "boost::") || startsWith(s, "class boost::") || startsWith(s, "__gnu_debug::") + // external library + || startsWith(s, "mdds::") // can't change our rtl layer || startsWith(s, "rtl::") // ignore anonymous namespace stuff, it is compilation-unit-local and the compiler will detect any -- cgit