This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19238] cannot change visibility of static variable in function template
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jan 2005 12:47:36 -0000
- Subject: [Bug c++/19238] cannot change visibility of static variable in function template
- References: <20050103105200.19238.jbeulich@novell.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jbeulich at novell dot com 2005-01-03 12:47 -------
I'm sorry, test case below. The expectation would be that the visibility
attribute gets inherited (as described above) from function template instances
and member functions of class template instances to their static variables.
If that conflicts with anything I can't think of right now, then the backup
solution would be to allow the attribute on such objects.
unsigned gu;
template<typename T> T test() __attribute__((__visibility__("hidden")));
template<typename T> T test() {
static T st;
return st = gu;
}
void test() {
test<unsigned>();
}
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed| |1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19238