This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51930] New: Explicitly instantiated template gets hidden visibility
- From: "sefi at s-e-f-i dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 21 Jan 2012 10:56:15 +0000
- Subject: [Bug c++/51930] New: Explicitly instantiated template gets hidden visibility
- Auto-submitted: auto-generated
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?