OSDN Git Service

2012-01-03 Chase Douglas <chase.douglas@canonical.com>
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Jan 2012 21:37:41 +0000 (21:37 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Jan 2012 21:37:41 +0000 (21:37 +0000)
    Jonathan Wakely  <jwakely.gcc@gmail.com>

* include/bits/shared_ptr.h: Default copy ctor and assignment.
* include/bits/shared_ptr_base.h: Likewise.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error
line numbers.
* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@182859 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/shared_ptr.h
libstdc++-v3/include/bits/shared_ptr_base.h
libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc
libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc

index 2eb57a5..7036b53 100644 (file)
@@ -1,3 +1,12 @@
+2012-01-03  Chase Douglas  <chase.douglas@canonical.com>
+           Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       * include/bits/shared_ptr.h: Default copy ctor and assignment.
+       * include/bits/shared_ptr_base.h: Likewise.
+       * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error
+       line numbers.
+       * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.
+
 2011-12-30  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR libstdc++/51711
index 8d32331..15c5549 100644 (file)
@@ -100,6 +100,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       constexpr shared_ptr()
       : __shared_ptr<_Tp>() { }
 
+      shared_ptr(const shared_ptr&) = default; // never throws
+
       /**
        *  @brief  Construct a %shared_ptr that owns the pointer @a __p.
        *  @param  __p  A pointer that is convertible to element_type*.
@@ -264,6 +266,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       constexpr shared_ptr(nullptr_t __p)
       : __shared_ptr<_Tp>(__p) { }
 
+      shared_ptr& operator=(const shared_ptr&) = default;
+
       template<typename _Tp1>
        shared_ptr&
        operator=(const shared_ptr<_Tp1>& __r) // never throws
index 156f7d2..bc34aff 100644 (file)
@@ -799,7 +799,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws
        { }
 
-      //  generated copy constructor, assignment, destructor are fine.
+      __shared_ptr(const __shared_ptr&) = default; // never throws
+      __shared_ptr& operator=(const __shared_ptr&) = default; // never throws
 
       template<typename _Tp1, typename = typename
               std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
index 36cf7f9..f5899d3 100644 (file)
@@ -35,6 +35,6 @@ void test01()
   // { dg-error "incomplete" "" { target *-*-* } 766 }
 
   std::shared_ptr<X> p9(ap());  // { dg-error "here" }
-  // { dg-error "incomplete" "" { target *-*-* } 858 }
+  // { dg-error "incomplete" "" { target *-*-* } 859 }
 
 }
index a210d04..046fd3c 100644 (file)
@@ -42,8 +42,8 @@ main()
   return 0;
 }
 
-// { dg-warning "note" "" { target *-*-* } 354 }
-// { dg-warning "note" "" { target *-*-* } 1085 }
+// { dg-warning "note" "" { target *-*-* } 358 }
+// { dg-warning "note" "" { target *-*-* } 1086 }
 // { dg-warning "note" "" { target *-*-* } 468 }
 // { dg-warning "note" "" { target *-*-* } 586 }
 // { dg-warning "note" "" { target *-*-* } 1049 }