Avoid bogus loplugin:dllmacro "unnecessary *DLLPUBLIC declaration ..."

...about the definition of __cxxabiv1::__cxa_exception in
bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx, when a declaration of that
struct has already been seen in /usr/include/c++/7/cxxabi.h in a

  #pragma GCC visibility push(default)
  ...
  #pragma GCC visibility pop

block (so that decl->getAttr<VisibilityAttr>() would point at the first of those
two pragmas).

Change-Id: I4af56be8ce84ace57a809a09da5c44d86fc4237a
This commit is contained in:
Stephan Bergmann
2017-09-29 16:33:45 +02:00
parent 740ef202a4
commit fa4431449d

View File

@@ -76,7 +76,8 @@ bool DllMacro::VisitNamedDecl(NamedDecl const * decl) {
<< p->getSourceRange();
}
}
else if (a->getVisibility() == VisibilityAttr::Default) {
else if (a->getVisibility() == VisibilityAttr::Default && !a->isInherited())
{
auto p = dyn_cast<CXXRecordDecl>(decl);
if (p && p->isCompleteDefinition() && !p->getDescribedClassTemplate()) {
// don't know what these macros mean, leave them alone