This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13289] [3.3/3.4 regression] ICE in regenerate_decl_from_template on recursive template
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Dec 2003 19:54:14 -0000
- Subject: [Bug c++/13289] [3.3/3.4 regression] ICE in regenerate_decl_from_template on recursive template
- References: <20031203235040.13289.gianni@mariani.ws>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2003-12-04 19:54 -------
The code I gave is certainly not valid, since it involves a recursive
dependence on templates.
For your code, one may argue that it is only valid if the compiler is
allowed to skip evaluating the unused arm of a conditional expression.
When you write
A<N>::i = (N ? A<N&0> : 0)
then
- if N==0: the code is recursive if we try to evaluate the first part
of the conditional, since it again involves A<0>::i, which we are
about to initialize
- if N!=0, then we get into the N==0 case on the next iteration.
I'm not sure if we are allowed to skip evaluation. Someone will be able to
point to the right place in the standard, though, I guess.
In either case, I don't care too much: raising the priority increases chances
to have the bug fixed, which I believe is always good :-)
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13289