LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 13009 - Missing warning on the visibility of bases and members
Summary: Missing warning on the visibility of bases and members
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: unspecified
Hardware: PC All
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-01 16:24 PDT by Rafael Ávila de Espíndola
Modified: 2013-04-15 16:38 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Ávila de Espíndola 2012-06-01 16:24:46 PDT
Newer gccs produce a warning in

struct __attribute__((visibility("hidden"))) foo {
};
struct bar {
  foo x; // bar has default visibility, but foo is hidden
};
struct zed : public foo { // zed has default visibility, but foo is hidden
};

I think it is a reasonable warning because

* If the type has a hidden member or base, that member or base was created locally (in the same DSO), so the type could also be hidden.
* If there is something strange going on, the warning is really easy to avoid, just make the visibility of bar and zed explicit.