This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/24791] ICE on invalid instantiation of template's static member



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]