http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52995
Bug #: 52995
Summary: Change in the handling of templates and visibility
attributes
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
in
-----------------------
#define HIDDEN __attribute__((visibility("hidden")))
#define DEFAULT __attribute__((visibility("default")))
template <class T> struct HIDDEN A {
static void DEFAULT bar();
};
struct HIDDEN H;
struct DEFAULT D;
void test() {
A<D>::bar(); // default
A<H>::bar(); // hidden
}
------------------------
gcc 4.5 would produce two default symbols (_ZN1AI1DE3barEv and
_ZN1AI1HE3barEv). Gcc 4.7 makes _ZN1AI1HE3barEv hidden.
I can't see why the hidden template argument should make A<H> "more hidden"
than A<D>.