egcs does not support a?b:c expressions as template integer parameter

Alexandre Oliva oliva@dcc.unicamp.br
Thu Jan 8 09:49:00 GMT 1998


Laurent Bonnaud writes:

>     loop<(I>0)?(I-1):0>::f(); // here is the problem
     loop<((I>0)?(I-1):0)>::f(); // here is the problem
          ^             ^

this is a bug indeed, but I found out extra parentheses help egcs/gcc
parse the program correctly.  The choice of angle brackets to specify
template arguments was a really bad one, as it makes parsing template
expressions very hard, but what is done is done :-(

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



More information about the Gcc mailing list