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

           Summary: [4.6 Regression] ICE: in decl_constant_var_p, at
                    cp/decl2.c:3562 on invalid recursive initialization
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: zso...@seznam.cz


------- testcase.C --------
template < int N > struct X {
  static const int value = X<N>::value;
};
template struct X<1000>;
---------------------------

Compiler output:
$ gcc testcase.C
testcase.C:2:34: error: template instantiation depth exceeds maximum of 1024
(use -ftemplate-depth= to increase the maximum) instantiating 'X<1000>::value'
testcase.C:2:34:   recursively instantiated from 'const int X<1000>::value'
testcase.C:2:34:   instantiated from 'const int X<1000>::value'
testcase.C:4:17:   instantiated from here

testcase.C:2:34: error: template instantiation depth exceeds maximum of 1024
(use -ftemplate-depth= to increase the maximum) instantiating 'X<1000>::value'
testcase.C:2:34:   recursively instantiated from 'const int X<1000>::value'
testcase.C:2:34:   instantiated from 'const int X<1000>::value'
testcase.C:4:17:   instantiated from here

testcase.C:2:34: internal compiler error: in decl_constant_var_p, at
cp/decl2.c:3562
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r166936 - crash
r165699 - OK
4.5 r166509 - OK

Reply via email to