aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2010-05-31 18:41:33 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2010-05-31 18:41:33 +0000
commit4585cf723650a3e5632649a52b354041c57e860d (patch)
tree85b85c938bcd3f83352e3681784ccac3c8ebf7e8 /libstdc++-v3/include/tr1
parent63f1c6992dd11f754e975580374b557db4c496b8 (diff)
downloadgcc-4585cf723650a3e5632649a52b354041c57e860d.zip
gcc-4585cf723650a3e5632649a52b354041c57e860d.tar.gz
gcc-4585cf723650a3e5632649a52b354041c57e860d.tar.bz2
re PR libstdc++/43820 (auto_ptr used with incomplete type no longer triggers warning)
2010-05-31 Jonathan Wakely <jwakely.gcc@gmail.com> PR libstdc++/43820 * include/bits/shared_ptr_base.h: Require complete type. * include/tr1/shared_ptr.h: Likewise. * testsuite/20_util/shared_ptr/cons/43820.cc: New. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820.cc: New. From-SVN: r160082
Diffstat (limited to 'libstdc++-v3/include/tr1')
-rw-r--r--libstdc++-v3/include/tr1/shared_ptr.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libstdc++-v3/include/tr1/shared_ptr.h b/libstdc++-v3/include/tr1/shared_ptr.h
index 6176b5e..f504e08 100644
--- a/libstdc++-v3/include/tr1/shared_ptr.h
+++ b/libstdc++-v3/include/tr1/shared_ptr.h
@@ -1,6 +1,6 @@
// <tr1/shared_ptr.h> -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -367,7 +367,7 @@ namespace tr1
: _M_ptr(__p), _M_refcount(__p)
{
__glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- // __glibcxx_function_requires(_CompleteConcept<_Tp1*>)
+ typedef int _IsComplete[sizeof(_Tp1)];
__enable_shared_from_this_helper(_M_refcount, __p, __p);
}
@@ -404,9 +404,9 @@ namespace tr1
explicit
__shared_ptr(std::auto_ptr<_Tp1>& __r)
: _M_ptr(__r.get()), _M_refcount()
- {
+ { // TODO requries delete __r.release() well-formed
__glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
- // TODO requires _Tp1 is complete, delete __r.release() well-formed
+ typedef int _IsComplete[sizeof(_Tp1)];
_Tp1* __tmp = __r.get();
_M_refcount = __shared_count<_Lp>(__r);
__enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);