------- Comment #2 from pinskia at gcc dot gnu dot org 2006-04-29 03:35 ------- The problem I think is the non specialization is getting in the way in that: template<class T> char const type_name<T>::name[] = ""; is recording the size as 1.
Another testcase with a slightly different error: emplate<class T> struct type_name { static int const name[]; }; template<class T> int const type_name<T>::name[] = {0}; template<> int const type_name<int>::name[] = {0, 1, 2, 3}; int f(void) { return type_name<int>::name[2]; } -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu dot | |org Known to fail|3.4.6 4.0.3 4.1.0 4.2.0 |3.4.6 4.0.3 4.1.0 4.2.0 | |3.4.0 Last reconfirmed|2006-04-28 13:33:30 |2006-04-29 03:35:43 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27347