Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Richard Henderson
On 11/04/2011 01:59 PM, Jason Merrill wrote: > Right, my point is that the comment before > cp_parser_transaction_expression refers to compound_statement, which > seems wrong. > > ...because the compound-statement variant is handled in cp_parser_transaction. Oh, duh. I was so focused on the attr

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Jason Merrill
On 11/04/2011 04:56 PM, Jason Merrill wrote: On 11/04/2011 04:14 PM, Richard Henderson wrote: On 11/04/2011 12:26 PM, Jason Merrill wrote: On 11/04/2011 03:23 PM, Richard Henderson wrote: (cp_parser_transaction_expression): Don't parse txn-attributes here. There's also the issue that the gra

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Jason Merrill
On 11/04/2011 04:14 PM, Richard Henderson wrote: On 11/04/2011 12:26 PM, Jason Merrill wrote: On 11/04/2011 03:23 PM, Richard Henderson wrote: (cp_parser_transaction_expression): Don't parse txn-attributes here. There's also the issue that the grammar uses compound-statement, whereas the

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Richard Henderson
On 11/04/2011 12:26 PM, Jason Merrill wrote: > On 11/04/2011 03:23 PM, Richard Henderson wrote: >> (cp_parser_transaction_expression): Don't parse txn-attributes here. > > There's also the issue that the grammar uses compound-statement, whereas the > code parses a parenthesized expression. T

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Jason Merrill
On 11/04/2011 03:23 PM, Richard Henderson wrote: (cp_parser_transaction_expression): Don't parse txn-attributes here. There's also the issue that the grammar uses compound-statement, whereas the code parses a parenthesized expression. Jason

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Richard Henderson
On 11/04/2011 11:31 AM, Jason Merrill wrote: > Speaking of which, that function's comment doesn't match the code: > >> + transaction-expression: >> + __transaction_atomic txn-exception-spec[opt] compound-statement >> + __transaction_relaxed txn-exception-spec[opt] compound-statement Fix

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Jason Merrill
On 11/04/2011 02:19 PM, Richard Henderson wrote: On 11/04/11 10:51, Jason Merrill wrote: Are you sure that [[attribute]] is the only way a [ can appear there? Yes. We're immediately following a keyword. The only two valid tokens that can follow that keyword are [ and {. Ah, I saw the cp_pa

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Richard Henderson
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_

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Aldy Hernandez
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

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Jason Merrill
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 [[attribut

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Aldy Hernandez
comma placement. Ciao, Michael. Committed. Thanks cp/parser.c (enum required_token): Fix comma. Index: parser.c === --- parser.c(revision 180772) +++ parser.c(working copy) @@ -171,9 +171,8 @@ typedef enum req

Re: [patch] 15/n: trans-mem: compiler C++ changes

2011-11-04 Thread Michael Matz
Hi, On Thu, 3 Nov 2011, Aldy Hernandez wrote: > +++ gcc/cp/parser.c (.../branches/transactional-memory) (revision > 180773) > @@ -172,6 +172,10 @@ typedef enum required_token { >RT_JUMP, /* jump-statement */ >RT_CLASS_KEY, /* class-key */ >RT_CLASS_TYPENAME_TEMPLATE /* class, ty