Commit 7350faad by Paolo Carlini Committed by Paolo Carlini

re PR c++/57682 (Uniform initialization syntax rejected in function-try-block)

/cp
2013-06-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/57682
	* parser.c (cp_parser_save_member_function_body): Handle correctly
	curly braces in function-try-block mem-initializers.

/testsuite
2013-06-28  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/57682
	* g++.dg/cpp0x/initlist73.C: New.

From-SVN: r200504
parent 1c342904
2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57682
* parser.c (cp_parser_save_member_function_body): Handle correctly
curly braces in function-try-block mem-initializers.
2013-06-27 Marc Glisse <marc.glisse@inria.fr>
PR c++/57509
......
......@@ -22798,12 +22798,14 @@ cp_parser_save_member_function_body (cp_parser* parser,
/* Save away the tokens that make up the body of the
function. */
first = parser->lexer->next_token;
/* Handle function try blocks. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TRY))
cp_lexer_consume_token (parser->lexer);
/* We can have braced-init-list mem-initializers before the fn body. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
{
cp_lexer_consume_token (parser->lexer);
while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)
&& cp_lexer_next_token_is_not_keyword (parser->lexer, RID_TRY))
while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
{
/* cache_group will stop after an un-nested { } pair, too. */
if (cp_parser_cache_group (parser, CPP_CLOSE_PAREN, /*depth=*/0))
......
2013-06-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57682
* g++.dg/cpp0x/initlist73.C: New.
2013-06-27 Meador Inge <meadori@codesourcery.com>
* gcc.dg/atomic-flag.c: Add dg-require-effective-target sync_*.
......
// PR c++/57682
// { dg-do compile { target c++11 } }
struct Class
{
Class (int func)
try
: f { func } { }
catch ( ... ) { }
private:
int f;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment