re PR libstdc++/65352 (array<T,0>::begin()/end() etc. forms a null reference and...
authorJonathan Wakely <jwakely@redhat.com>
Thu, 28 May 2015 16:00:09 +0000 (17:00 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 28 May 2015 16:00:09 +0000 (17:00 +0100)
PR libstdc++/65352
* include/profile/array (array::data): Use _S_ptr.
* include/debug/array (array::data): Likewise.

From-SVN: r223838

libstdc++-v3/ChangeLog
libstdc++-v3/include/debug/array
libstdc++-v3/include/profile/array

index aea089adef8f97cdc732a2609312d893af956263..286197c3f6ba903a7295ca112688455e327531b4 100644 (file)
@@ -1,5 +1,9 @@
 2015-05-28  Jonathan Wakely  <jwakely@redhat.com>
 
+       PR libstdc++/65352
+       * include/profile/array (array::data): Use _S_ptr.
+       * include/debug/array (array::data): Likewise.
+
        PR libstdc++/65352
        * include/std/array (__array_traits::_S_ptr): New function.
        (array::data): Use _S_ptr to avoid creating invalid reference.
index 31d146e9356111c6ecd5248658f37d19f0da257a..411e816d315d7e7a3bc35decd5a9668736c20d8c 100644 (file)
@@ -216,11 +216,11 @@ namespace __debug
 
       pointer
       data() noexcept
-      { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+      { return _AT_Type::_S_ptr(_M_elems); }
 
       const_pointer
       data() const noexcept
-      { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+      { return _AT_Type::_S_ptr(_M_elems); }
     };
 
   // Array comparisons.
index a90e396cae309e49868b6a80795f0f16119b3cef..5198bb3af9c09569441321ac54707c0235859d69 100644 (file)
@@ -178,11 +178,11 @@ namespace __profile
 
       pointer
       data() noexcept
-      { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+      { return _AT_Type::_S_ptr(_M_elems); }
 
       const_pointer
       data() const noexcept
-      { return std::__addressof(_AT_Type::_S_ref(_M_elems, 0)); }
+      { return _AT_Type::_S_ptr(_M_elems); }
     };
 
   // Array comparisons.