Explicit template instantiation and -fvisibility. Gcc bug?

Ian Lance Taylor iant@google.com
Tue Nov 18 15:29:00 GMT 2008


"Jeroen Wijnhout" <jeroen.wijnhout@gmail.com> writes:

> The cause seems to be the instantiation of
> DependentTemplatedClass<TemplatedClass<int > >, which induces an
> instantiation of TemplatedClass<int> as well. However I would expect
> this instantiation to have public visibility as well, because the
> DependentTemplatedClass instantiation is public. Is this a GCC bug, or
> am I doing something wrong here?

The semantics of how visibility should work with C++ classes and
templates are obscure and probably still not fully pinned down.  There
has been work in each recent gcc release to address this in various
ways.  You neglected to mention which version of gcc you are using.  I
would recommend trying your program with mainline (the future gcc
4.4).  If it does not behave as you expect, file a bug report (see
http://gcc.gnu.org/bugs.html ).  Thanks.

Ian



More information about the Gcc-help mailing list