This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/10150: Internal compiler error generated by stupid template code
- From: te200 at eng dot cam dot ac dot uk
- To: gcc-gnats at gcc dot gnu dot org
- Date: 19 Mar 2003 14:25:35 -0000
- Subject: c++/10150: Internal compiler error generated by stupid template code
- Reply-to: te200 at eng dot cam dot ac dot uk
>Number: 10150
>Category: c++
>Synopsis: Internal compiler error generated by stupid template code
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Wed Mar 19 14:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Tom Evans
>Release: 3.2.1
>Organization:
>Environment:
djgpp, Win98.
>Description:
When I try to compile the code given, I get an internal compiler error. I can't test it on a proper gcc easily, so this is only in djgpp. So if you can't reproduce it straight away, chuck this report in the bin.
Note no workaround is needed - the code is stupid, I just thought it still shouldn't generate an internal error.
Attempted compile with 'gxx -c a.cc', got:
a.cc: In instantiation of `Pow<0>::In<0>':
a.cc:9: instantiated from here
a.cc:9: Internal compiler error in resolve_offset_ref, at cp/init.c:1891
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
template <int N>
struct Pow {
template <int Val>
struct In {
enum { value = Val * Pow<N-1>::In };
};
};
Pow<0>::In<0> a;
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: