diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0334-PR-c-45418.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0334-PR-c-45418.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0334-PR-c-45418.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0334-PR-c-45418.patch new file mode 100644 index 0000000000..74627bf5b8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0334-PR-c-45418.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 6681641e6f9638bf4a8b80be12858ab438be0152 Mon Sep 17 00:00:00 2001 | ||
2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Wed, 25 May 2011 15:26:33 +0000 | ||
4 | Subject: [PATCH] PR c++/45418 | ||
5 | * init.c (perform_member_init): Handle list-initialization | ||
6 | of array of non-trivial class type. | ||
7 | |||
8 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174209 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
9 | |||
10 | index 286bfb6..172a71a 100644 | ||
11 | --- a/gcc/cp/init.c | ||
12 | +++ b/gcc/cp/init.c | ||
13 | @@ -528,6 +528,8 @@ perform_member_init (tree member, tree init) | ||
14 | { | ||
15 | gcc_assert (TREE_CHAIN (init) == NULL_TREE); | ||
16 | init = TREE_VALUE (init); | ||
17 | + if (BRACE_ENCLOSED_INITIALIZER_P (init)) | ||
18 | + init = digest_init (type, init); | ||
19 | } | ||
20 | if (init == NULL_TREE | ||
21 | || same_type_ignoring_top_level_qualifiers_p (type, | ||
22 | new file mode 100644 | ||
23 | index 0000000..ef4e72c | ||
24 | --- /dev/null | ||
25 | +++ b/gcc/testsuite/g++.dg/cpp0x/initlist50.C | ||
26 | @@ -0,0 +1,21 @@ | ||
27 | +// PR c++/45418 | ||
28 | +// { dg-options -std=c++0x } | ||
29 | + | ||
30 | +struct A1 { }; | ||
31 | +struct A2 { | ||
32 | + A2(); | ||
33 | +}; | ||
34 | + | ||
35 | +template <class T> struct B { | ||
36 | + T ar[1]; | ||
37 | + B(T t):ar({t}) {} | ||
38 | +}; | ||
39 | + | ||
40 | +int main(){ | ||
41 | + B<int> bi{1}; | ||
42 | + A1 a1; | ||
43 | + B<A1> ba1{a1}; | ||
44 | + A2 a2; | ||
45 | + A2 a2r[1]{{a2}}; | ||
46 | + B<A2> ba2{a2}; | ||
47 | +} | ||
48 | -- | ||
49 | 1.7.0.4 | ||
50 | |||