[Bug c++/51930] New: Explicitly instantiated template gets hidden visibility
sefi@s-e-f-i.de
gcc-bugzilla@gcc.gnu.org
Sat Jan 21 11:41:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51930
Bug #: 51930
Summary: Explicitly instantiated template gets hidden
visibility
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: sefi@s-e-f-i.de
gcc-4.7 produces a symbol with hidden visibility for testfunc<foo>, while
gcc-4.6 produces a symbol with default visibility.
struct foo
{
};
template<
typename T
>
__attribute__ ((visibility("default")))
void testfunc();
template<
typename T
>
void testfunc()
{
}
template
__attribute__ ((visibility("default")))
void testfunc<foo>();
I compiled this with
g++-4.7 -fvisibility=hidden -shared test.cpp
If I replace
struct foo {};
with
struct __attribute__ ((visibility("default"))) foo {};
then testfunc<foo> gets default visibility even with gcc-4.7.
Is this intentional?
More information about the Gcc-bugs
mailing list