diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0337-PR-c-47184.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0337-PR-c-47184.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0337-PR-c-47184.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0337-PR-c-47184.patch new file mode 100644 index 0000000000..c3d02ef19e --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0337-PR-c-47184.patch @@ -0,0 +1,64 @@ +From b7eebf48e80a907e875b82beb837379b5d93f8e2 Mon Sep 17 00:00:00 2001 +From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Wed, 25 May 2011 20:29:39 +0000 +Subject: [PATCH] PR c++/47184 + * parser.c (cp_parser_parameter_declaration): Recognize + list-initialization. + (cp_parser_direct_declarator): Check for the closing + paren before parsing definitely. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174232 138bc75d-0d04-0410-961f-82ee72b054a4 + +index 4c7d9cb..4d6ddcc 100644 +--- a/gcc/cp/parser.c ++++ b/gcc/cp/parser.c +@@ -15031,6 +15031,9 @@ cp_parser_direct_declarator (cp_parser* parser, + parser->num_template_parameter_lists + = saved_num_template_parameter_lists; + ++ /* Consume the `)'. */ ++ cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN); ++ + /* If all went well, parse the cv-qualifier-seq and the + exception-specification. */ + if (member_p || cp_parser_parse_definitely (parser)) +@@ -15044,8 +15047,6 @@ cp_parser_direct_declarator (cp_parser* parser, + if (ctor_dtor_or_conv_p) + *ctor_dtor_or_conv_p = *ctor_dtor_or_conv_p < 0; + first = false; +- /* Consume the `)'. */ +- cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN); + + /* Parse the cv-qualifier-seq. */ + cv_quals = cp_parser_cv_qualifier_seq_opt (parser); +@@ -16132,6 +16133,7 @@ cp_parser_parameter_declaration (cp_parser *parser, + of some object of type "char" to "int". */ + && !parser->in_type_id_in_expr_p + && cp_parser_uncommitted_to_tentative_parse_p (parser) ++ && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE) + && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN)) + cp_parser_commit_to_tentative_parse (parser); + /* Parse the declarator. */ +new file mode 100644 +index 0000000..9163dd3 +--- /dev/null ++++ b/gcc/testsuite/g++.dg/cpp0x/initlist51.C +@@ -0,0 +1,15 @@ ++// PR c++/47184 ++// { dg-options -std=c++0x } ++ ++struct S ++{ ++ int a; ++}; ++struct T ++{ ++ T(S s) {} ++}; ++int main() ++{ ++ T t(S{1}); ++} +-- +1.7.0.4 + |