OSDN Git Service

2012-11-20 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Nov 2012 14:54:36 +0000 (14:54 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Nov 2012 14:54:36 +0000 (14:54 +0000)
PR libstdc++/55413
* include/bits/hashtable.h (_Hashtable<>::_M_rehash_aux): Initialize
__bbegin_bkt and __prev_bkt to avoid uninitialized warnings.
* testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
dg-error line number.

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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc

index 8085f24..3feb458 100644 (file)
@@ -1,3 +1,11 @@
+2012-11-20  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/55413
+       * include/bits/hashtable.h (_Hashtable<>::_M_rehash_aux): Initialize
+       __bbegin_bkt and __prev_bkt to avoid uninitialized warnings.
+       * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
+       dg-error line number.
+
 2012-11-15  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        PR libstdc++/53841
index dca4de3..b58189f 100644 (file)
@@ -1,7 +1,6 @@
 // hashtable.h header -*- C++ -*-
 
-// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
-// Free Software Foundation, Inc.
+// Copyright (C) 2007-2012 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
@@ -1637,7 +1636,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       _Bucket* __new_buckets = _M_allocate_buckets(__n);
       _Node* __p = _M_begin();
       _M_before_begin._M_nxt = nullptr;
-      std::size_t __bbegin_bkt;
+      std::size_t __bbegin_bkt = 0;
       while (__p)
        {
          _Node* __next = __p->_M_next();
@@ -1678,8 +1677,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       _Node* __p = _M_begin();
       _M_before_begin._M_nxt = nullptr;
-      std::size_t __bbegin_bkt;
-      std::size_t __prev_bkt;
+      std::size_t __bbegin_bkt = 0;
+      std::size_t __prev_bkt = 0;
       _Node* __prev_p = nullptr;
       bool __check_bucket = false;
 
@@ -1707,8 +1706,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            {
              if (__check_bucket)
                {
-                 // Check if we shall update the next bucket because of insertions
-                 // into __prev_bkt bucket.
+                 // Check if we shall update the next bucket because of
+                 // insertions into __prev_bkt bucket.
                  if (__prev_p->_M_nxt)
                    {
                      std::size_t __next_bkt
index 2135979..3a6984c 100644 (file)
@@ -19,7 +19,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-error "static assertion failed" "" { target *-*-* } 186 }
+// { dg-error "static assertion failed" "" { target *-*-* } 185 }
 
 #include <unordered_set>