summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-09-29 16:33:45 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-09-29 16:33:45 +0200
commitfa4431449d0306e8179f53a2a69c549800bd24bd (patch)
tree66ad3e944057b702aa7f3be6d664bf42050efabb
parent740ef202a4e3ae3752c95838e5797167b6eb2105 (diff)
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
-rw-r--r--compilerplugins/clang/dllmacro.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/compilerplugins/clang/dllmacro.cxx b/compilerplugins/clang/dllmacro.cxx
index 538203f88942..66664888419c 100644
--- a/compilerplugins/clang/dllmacro.cxx
+++ b/compilerplugins/clang/dllmacro.cxx
@@ -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