[Bug c++/61857] An init-capturing lambda is parsed incorrectly when used in a braced-init-list

2014-09-23 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61857

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #2 from Paolo Carlini paolo.carlini at oracle dot com ---
Mine.


[Bug c++/61857] An init-capturing lambda is parsed incorrectly when used in a braced-init-list

2014-09-23 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61857

--- Comment #3 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org ---
Author: paolo
Date: Tue Sep 23 18:07:59 2014
New Revision: 215528

URL: https://gcc.gnu.org/viewcvs?rev=215528root=gccview=rev
Log:
/cp
2014-09-23  Paolo Carlini  paolo.carl...@oracle.com

PR c++/61857
* parser.c (cp_parser_skip_to_closing_square_bracket,
cp_parser_array_designator_p): New.
(cp_parser_initializer_list): Use the latter.

/testsuite
2014-09-23  Paolo Carlini  paolo.carl...@oracle.com

PR c++/61857
* g++.dg/cpp1y/lambda-init10.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/lambda-init10.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog


[Bug c++/61857] An init-capturing lambda is parsed incorrectly when used in a braced-init-list

2014-09-23 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61857

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org
   Target Milestone|--- |5.0

--- Comment #4 from Paolo Carlini paolo.carlini at oracle dot com ---
Fixed.


[Bug c++/61857] An init-capturing lambda is parsed incorrectly when used in a braced-init-list

2014-09-22 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61857

--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com ---
In our case the issue is slightly different, the problem is in
cp_parser_initializer_list, here:

  cp_parser_parse_tentatively (parser);
  cp_lexer_consume_token (parser-lexer);
  designator = cp_parser_constant_expression (parser, true, non_const);
  cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
  cp_parser_require (parser, CPP_EQ, RT_EQ);
  if (!cp_parser_parse_definitely (parser))
designator = NULL_TREE;
  else if (non_const)
require_potential_rvalue_constant_expression (designator);

where cp_parser_constant_expression is tentatively called. I think it can be
solved by looking forward for the '=', similarly to other GNU extensions, for
example compound literals.


[Bug c++/61857] An init-capturing lambda is parsed incorrectly when used in a braced-init-list

2014-07-20 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61857

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-07-20
 Ever confirmed|0   |1