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++/13289] [3.3/3.4 regression] ICE in regenerate_decl_from_template on recursive template


------- Additional Comments From reichelt at gcc dot gnu dot org  2003-12-04 17:26 -------
First, here's a slightly different example that triggers the ICE:

==============================================================
template <int> struct A
{
    static const int i;
};

template <int N> const int A<N>::i = ( N ? A<N&0>::i : 0 );

int j=A<1>::i;
==============================================================

x.cc: In instantiation of `const int A<0>::i':
x.cc:10:   instantiated from `const int A<0>::i'
x.cc:10:   instantiated from `const int A<1>::i'
x.cc:12:   instantiated from here
x.cc:10: internal compiler error: in regenerate_decl_from_template, at
cp/pt.c:10771
Please submit a full bug report, [etc.]

If I replace "N&0" by "0" in the example above, I get the following
error message:

x.cc:10: error: template instantiation depth exceeds maximum of 500 (use
-ftemplate-depth-NN to increase the maximum) instantiating `A<0>::i'
x.cc:10:   instantiated from `const int A<0>::i'
[repeated ~1000 times]
x.cc:12:   instantiated from here


Second, I don't agree with Wolfgang. This code looks valid to me
(and is accepted by gcc 3.0 - 3.2.3 as well as icc 7 and Comeau).
Thus, we have a regression here and therefore severity "critical".


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |critical
            Summary|ICE in                      |[3.3/3.4 regression] ICE in
                   |regenerate_decl_from_templat|regenerate_decl_from_templat
                   |e on recursive template     |e on recursive template


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13289


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