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