------- 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