]> code.ossystems Code Review - openembedded-core.git/blob
b979bbe2da1d83dbb7e47610ed46be92ca98ad7b
[openembedded-core.git] /
1 Upstream-Status: Inappropriate [Backport]
2 From fffee2aba06d51178d5c653db0acd6c775a0326b Mon Sep 17 00:00:00 2001
3 From: paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
4 Date: Sat, 16 Apr 2011 02:04:56 +0000
5 Subject: [PATCH 130/200] 2011-04-15  Daniel Krugler  <daniel.kruegler@googlemail.com>
6             Paolo Carlini  <paolo.carlini@oracle.com>
7
8         PR libstdc++/48631
9         * include/bits/unique_ptr.h (default_delete<_Tp[]>): Add deleted
10         function call operator.
11         * testsuite/20_util/default_delete/48631_neg.cc: New.
12         * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
13         line numbers.
14
15
16 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172535 138bc75d-0d04-0410-961f-82ee72b054a4
17
18 index 1be2e7a..9ab1938 100644
19 --- a/libstdc++-v3/include/bits/unique_ptr.h
20 +++ b/libstdc++-v3/include/bits/unique_ptr.h
21 @@ -79,6 +79,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
22                       "can't delete pointer to incomplete type");
23         delete [] __ptr;
24        }
25 +
26 +      template<typename _Up> void operator()(_Up*) const = delete;
27      };
28  
29    /// 20.7.12.2 unique_ptr for single objects.
30 diff --git a/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc b/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
31 new file mode 100644
32 index 0000000..9d779ac
33 --- /dev/null
34 +++ b/libstdc++-v3/testsuite/20_util/default_delete/48631_neg.cc
35 @@ -0,0 +1,30 @@
36 +// { dg-options "-std=gnu++0x " }
37 +// { dg-do compile }
38 +
39 +// Copyright (C) 2011 Free Software Foundation
40 +//
41 +// This file is part of the GNU ISO C++ Library.  This library is free
42 +// software; you can redistribute it and/or modify it under the
43 +// terms of the GNU General Public License as published by the
44 +// Free Software Foundation; either version 3, or (at your option)
45 +// any later version.
46 +
47 +// This library is distributed in the hope that it will be useful,
48 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
49 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50 +// GNU General Public License for more details.
51 +
52 +// You should have received a copy of the GNU General Public License along
53 +// with this library; see the file COPYING3.  If not see
54 +// <http://www.gnu.org/licenses/>.
55 +
56 +#include <memory>
57 +
58 +struct B { };
59 +struct D : B { };
60 +
61 +// libstdc++/48631
62 +D d;
63 +std::default_delete<B[]> db;
64 +typedef decltype(db(&d)) type; // { dg-error "use of deleted function" }
65 +// { dg-error "declared here" "" { target *-*-* } 83 }
66 diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc
67 index 28c8797..63f44d1 100644
68 --- a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc
69 +++ b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc
70 @@ -44,7 +44,7 @@ main()
71  
72  // { dg-warning "note" "" { target *-*-* } 354 }
73  // { dg-warning "note" "" { target *-*-* } 1086 }
74 -// { dg-warning "note" "" { target *-*-* } 467 }
75 +// { dg-warning "note" "" { target *-*-* } 469 }
76  // { dg-warning "note" "" { target *-*-* } 587 }
77  // { dg-warning "note" "" { target *-*-* } 1050 }
78  // { dg-warning "note" "" { target *-*-* } 1056 }
79 -- 
80 1.7.0.4
81