From: Stefan S. <se...@sy...> - 2004-07-16 18:04:06
|
Stefan Seefeld wrote: > hi there, > > The following valid code doesn't parse with opencxx: > > --- > > template <typename T> void Foo(); > > void (*bar)() = &Foo<int>; > > --- > > I'll look into it, but in case someone else (Grzegorz, Chiba ?) > has an idea, I'll send it to the list. A little follow-up: after '&Foo' has been parsed, 'Parser::isTemplateArgs' is been called. However, as the comment above that method indicates: /* template.args : '<' any* '>' template.args must be followed by '(' or '::' */ which obviously doesn't account for this case where a function pointer is passed, i.e. no terminating '('. Now I'm a bit lost. I guess the '(' constraint is used to disambigate from a relational expression, i.e. if we drop it, we'll misinterpret other expressions. Could I simply add ';' and ',' to the list of symbols potentially following the template args ? May be I should have a look into the new C++ parser used in gcc 3.4... Any ideas ? Chiba ? Kind regards, Stefan |