[Bug c++/51930] [4.7 regression] Explicitly instantiated template gets hidden visibility

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 15 10:15:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51930

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-15 10:15:06 UTC ---
(In reply to comment #7)
> The test struct might come from an external library I have no control of, which
> will make it difficult to change its visibility.

You could declare the struct before including that library's headers and set
its visibility with a pragma:

#pragma GCC visibility push(default)
struct test;
#pragma GCC visibility pop



More information about the Gcc-bugs mailing list