public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26612]  New: visibility and ODR
@ 2006-03-09  0:52 geoffk at gcc dot gnu dot org
  2006-03-09  0:54 ` [Bug c++/26612] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2006-03-09  0:52 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-08-28 12:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-09  0:52 [Bug c++/26612] New: visibility and ODR geoffk at gcc dot gnu dot org
2006-03-09  0:54 ` [Bug c++/26612] " pinskia at gcc dot gnu dot org
2006-04-05 22:44 ` jason at gcc dot gnu dot org
2006-04-05 22:48 ` jason at gcc dot gnu dot org
2006-04-05 22:49 ` jason at gcc dot gnu dot org
2006-06-30  1:17 ` jason at gcc dot gnu dot org
2006-06-30 15:32 ` pinskia at gcc dot gnu dot org
2006-06-30 16:42 ` pinskia at gcc dot gnu dot org
2006-08-28 12:28 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).