[Bug c++/52995] New: Change in the handling of templates and visibility attributes
rafael.espindola at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Apr 15 11:57:00 GMT 2012
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: unassigned@gcc.gnu.org
ReportedBy: rafael.espindola@gmail.com
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>.
More information about the Gcc-bugs
mailing list