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 @@ | |||
1 | From b7eebf48e80a907e875b82beb837379b5d93f8e2 Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 25 May 2011 20:29:39 +0000 | ||
4 | Subject: [PATCH] PR c++/47184 | ||
5 | * parser.c (cp_parser_parameter_declaration): Recognize | ||
6 | list-initialization. | ||
7 | (cp_parser_direct_declarator): Check for the closing | ||
8 | paren before parsing definitely. | ||
9 | |||
10 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174232 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
11 | |||
12 | index 4c7d9cb..4d6ddcc 100644 | ||
13 | --- a/gcc/cp/parser.c | ||
14 | +++ b/gcc/cp/parser.c | ||
15 | @@ -15031,6 +15031,9 @@ cp_parser_direct_declarator (cp_parser* parser, | ||
16 | parser->num_template_parameter_lists | ||
17 | = saved_num_template_parameter_lists; | ||
18 | |||
19 | + /* Consume the `)'. */ | ||
20 | + cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN); | ||
21 | + | ||
22 | /* If all went well, parse the cv-qualifier-seq and the | ||
23 | exception-specification. */ | ||
24 | if (member_p || cp_parser_parse_definitely (parser)) | ||
25 | @@ -15044,8 +15047,6 @@ cp_parser_direct_declarator (cp_parser* parser, | ||
26 | if (ctor_dtor_or_conv_p) | ||
27 | *ctor_dtor_or_conv_p = *ctor_dtor_or_conv_p < 0; | ||
28 | first = false; | ||
29 | - /* Consume the `)'. */ | ||
30 | - cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN); | ||
31 | |||
32 | /* Parse the cv-qualifier-seq. */ | ||
33 | cv_quals = cp_parser_cv_qualifier_seq_opt (parser); | ||
34 | @@ -16132,6 +16133,7 @@ cp_parser_parameter_declaration (cp_parser *parser, | ||
35 | of some object of type "char" to "int". */ | ||
36 | && !parser->in_type_id_in_expr_p | ||
37 | && cp_parser_uncommitted_to_tentative_parse_p (parser) | ||
38 | + && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE) | ||
39 | && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN)) | ||
40 | cp_parser_commit_to_tentative_parse (parser); | ||
41 | /* Parse the declarator. */ | ||
42 | new file mode 100644 | ||
43 | index 0000000..9163dd3 | ||
44 | --- /dev/null | ||
45 | +++ b/gcc/testsuite/g++.dg/cpp0x/initlist51.C | ||
46 | @@ -0,0 +1,15 @@ | ||
47 | +// PR c++/47184 | ||
48 | +// { dg-options -std=c++0x } | ||
49 | + | ||
50 | +struct S | ||
51 | +{ | ||
52 | + int a; | ||
53 | +}; | ||
54 | +struct T | ||
55 | +{ | ||
56 | + T(S s) {} | ||
57 | +}; | ||
58 | +int main() | ||
59 | +{ | ||
60 | + T t(S{1}); | ||
61 | +} | ||
62 | -- | ||
63 | 1.7.0.4 | ||
64 | |||