On 11/04/2011 11:16 AM, Aldy Hernandez wrote: > On 11/04/11 10:51, Jason Merrill wrote: >> On 11/03/2011 02:53 PM, Aldy Hernandez wrote: >>> + if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_SQUARE)) >>> + return NULL_TREE; >>> + cp_lexer_consume_token (parser->lexer); >>> + if (!cp_parser_require (parser, CPP_OPEN_SQUARE, RT_OPEN_SQUARE)) >>> + goto error1; >> >> Are you sure that [[attribute]] is the only way a [ can appear there? >> What about lambdas? Just return NULL_TREE here if you see one [ followed >> by something else. cp_lexer_peek_nth_token should be useful.
Yes. We're immediately following a keyword. The only two valid tokens that can follow that keyword are [ and {. r~