On 09/20/2010 07:06 PM, Rodrigo Rivas wrote:
Are you sure? As I said in other post, I am no longer sure that the
C++0x draft forbids the type definition in this context.
But I'm no expert in standarese, so I'm still undecided.

It took me some searching, but yes, it does:

"A type-specifier-seq shall not define a class or enumeration unless it appears in the type-id of an alias-declaration (7.1.3)."

Normal declarations don't have a type-specifier-seq, they have a decl-specifier-seq.

I would change cp_parser_range_for to use cp_parser_decl_specifier_seq instead of cp_parser_type_specifier_seq and then wait to complain about defining a type until after we've seen the ':'.

Jason

Reply via email to