]> code.ossystems Code Review - openembedded-core.git/blob
44f5d3583a82c76ff3449aa9c33058579336ebd6
[openembedded-core.git] /
1 Upstream-Status: Inappropriate [Backport]
2 From 19692feb0bd83e8e6b3a1e1e0b43119d7e12ce96 Mon Sep 17 00:00:00 2001
3 From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
4 Date: Thu, 21 Apr 2011 04:27:30 +0000
5 Subject: [PATCH 160/200]        * semantics.c (finish_compound_literal): Don't put an array
6         with a dtor in a static variable.
7
8 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172806 138bc75d-0d04-0410-961f-82ee72b054a4
9
10 index cf8d329..0d80771 100644
11 --- a/gcc/cp/semantics.c
12 +++ b/gcc/cp/semantics.c
13 @@ -2333,6 +2333,7 @@ finish_compound_literal (tree type, tree compound_literal)
14       represent class temporaries with TARGET_EXPR so we elide copies.  */
15    if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
16        && TREE_CODE (type) == ARRAY_TYPE
17 +      && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
18        && initializer_constant_valid_p (compound_literal, type))
19      {
20        tree decl = create_temporary_var (type);
21 new file mode 100644
22 index 0000000..b76fb58
23 --- /dev/null
24 +++ b/gcc/testsuite/g++.dg/cpp0x/initlist47.C
25 @@ -0,0 +1,9 @@
26 +// { dg-options -std=c++0x }
27 +
28 +struct A { ~A() = delete; };   // { dg-error "declared" }
29 +
30 +int main()
31 +{
32 +  typedef const A cA[2];
33 +  cA{};                                // { dg-error "deleted" }
34 +}
35 -- 
36 1.7.0.4
37