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


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