This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52995] New: Change in the handling of templates and visibility attributes
- From: "rafael.espindola at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 15 Apr 2012 11:56:56 +0000
- Subject: [Bug c++/52995] New: Change in the handling of templates and visibility attributes
- Auto-submitted: auto-generated
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>.