This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22592] -fvisibility-inlines-hidden broken differently
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2006 23:28:03 -0000
- Subject: [Bug c++/22592] -fvisibility-inlines-hidden broken differently
- References: <bug-22592-183@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from jason at gcc dot gnu dot org 2006-06-13 23:28 -------
Either 20218 is a bug or this is. It seems to me that 20218 is the bug.
If you declare a function to be hidden, you are asserting that it will be
defined in the current DSO. From the GCC documentation:
"Two declarations of an object with hidden linkage refer to the same object
if they are in the same shared object."
Calling this function directly is a correct optimization, the bug is that you
fail to define it (by defining the key method) in the same DSO.
If this class is imported from a library, it shouldn't have hidden linkage; the
library's namespace should have explicit default linkage.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22592