This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24791] ICE on invalid instantiation of template's static member
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Nov 2005 10:39:18 -0000
- Subject: [Bug c++/24791] ICE on invalid instantiation of template's static member
- References: <bug-24791-9385@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from reichelt at gcc dot gnu dot org 2005-11-17 10:39 -------
Confirmed.
The following code snippet causes an ICE since 2.95.3
with the exception of 4.0.0 - 4.0.2:
==================================
template<int> struct A
{
static int i;
A() { ++i; }
};
template<int> int A<0>::i(0);
A<0> a;
==================================
The following variation causes an ICE since 4.0.0 (and before 3.1)
and is accepted by GCC 3.1 - 3.4.5:
==================================
template<int> struct A
{
static int i;
};
template<int> int A<0>::i(0);
==================================
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |accepts-invalid, monitored
Known to fail|2.95.3 3.0.4 |
Last reconfirmed|0000-00-00 00:00:00 |2005-11-17 10:39:17
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24791