This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26612] New: visibility and ODR
- From: "geoffk at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Mar 2006 00:52:44 -0000
- Subject: [Bug c++/26612] New: visibility and ODR
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In bug 10591, it's pointed out that you can use the ODR rules to clear the
TREE_PUBLIC flag. You can do the same thing to make something have hidden
visibility even though it's not declared so.
In fact, this is a requirement. For example, in bug 19664, I mention that if
the user declares
struct mytype __attribute__((visibility(hidden))) { ... };
vector<mytype> x;
then everything to do with 'vector<mytype>' needs to be hidden, because a user
could do the same thing in a different shared object with a different 'mytype'.
Likewise,
struct a_struct __attribute__((visibility(hidden)));
void foo(a_struct &) { }
Even though "foo" is not marked hidden it should still be hidden, because it
could be overloaded in a different shared object with a parameter which has
type 'a_struct &' but is a different type.
This is especially important when 'func' is 'operator ==' or similar.
--
Summary: visibility and ODR
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: geoffk at gcc dot gnu dot org
OtherBugsDependingO 19664
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26612