More adaption to Clang 3.4

...where NmaedDecl::getQualifiedNameAsString (which is expensive and bad,
anyway) apparently returns something other than "(anonymous namespace)"

Change-Id: I05ef96665c48f8f596dd0d317388e91a75b8307b
This commit is contained in:
Stephan Bergmann
2016-06-28 17:48:22 +02:00
parent 429f4e294e
commit c1ab6613ae
3 changed files with 61 additions and 11 deletions

View File

@@ -9,8 +9,9 @@
#include "clang/AST/Attr.h"
#include "plugin.hxx"
#include "compat.hxx"
#include "plugin.hxx"
#include "typecheck.hxx"
/*
Look for member functions that can be static
@@ -118,12 +119,14 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
}
// can't change it because in debug mode it can't be static
// sal/cpprt/operators_new_delete.cxx
if (aParentName == "(anonymous namespace)::AllocatorTraits") {
auto dc = loplugin::DeclCheck(pCXXMethodDecl->getParent());
if (dc.Struct("AllocatorTraits").AnonymousNamespace().GlobalNamespace()) {
return true;
}
// in this case, the code is taking the address of the member function
// shell/source/unix/sysshell/recently_used_file_handler.cxx
if (aParentName == "(anonymous namespace)::recently_used_item") {
if (dc.Struct("recently_used_item").AnonymousNamespace().GlobalNamespace())
{
return true;
}
// the unotools and svl config code stuff is doing weird stuff with a reference-counted statically allocated pImpl class