This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51930] New: Explicitly instantiated template gets hidden visibility


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]