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