]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite_containers.h (populate<>::populate(_Tp&)): Avoid used uninitialized warning.
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 10 Dec 2009 13:17:56 +0000 (13:17 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 10 Dec 2009 13:17:56 +0000 (13:17 +0000)
2009-12-10  Paolo Carlini  <paolo.carlini@oracle.com>

* testsuite/util/testsuite_containers.h (populate<>::populate(_Tp&)):
Avoid used uninitialized warning.
* include/ext/pb_ds/detail/cc_hash_table_map_/
constructor_destructor_fn_imps.hpp: Fix typo causing sequence point
warning.

From-SVN: r155127

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
libstdc++-v3/testsuite/util/testsuite_containers.h

index 3d9b49a1e8cb84c098c525dfda92ad17466054af..22970112aa4018ca25f520f7bafd4bcd089206de 100644 (file)
@@ -1,3 +1,11 @@
+2009-12-10  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * testsuite/util/testsuite_containers.h (populate<>::populate(_Tp&)):
+       Avoid used uninitialized warning. 
+       * include/ext/pb_ds/detail/cc_hash_table_map_/
+       constructor_destructor_fn_imps.hpp: Fix typo causing sequence point
+       warning.
+
 2009-12-09  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/profile/impl/profiler_container_size.h: Fix include
index 57111537319693169b002fda66741843f9ca073a..24294ad9135330149eb205de832ae18ce0d1132a 100644 (file)
@@ -129,7 +129,7 @@ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) :
   PB_DS_HASH_EQ_FN_C_DEC(other),
   resize_base(other), ranged_hash_fn_base(other),
   m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
-  m_entries(m_entries = s_entry_pointer_allocator.allocate(m_num_e))
+  m_entries(s_entry_pointer_allocator.allocate(m_num_e))
 {
   initialize();
   _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();)
index 62bf38f3d1c839078def4f92693d101ac3f1d6ec..af07441fbd0236114fb85e0ac231d100f60be143 100644 (file)
@@ -149,9 +149,10 @@ namespace __gnu_test
     {
       populate(_Tp& container)
       {
-       typename _Tp::value_type v;
-       container.insert(container.begin(), v);
-       container.insert(container.begin(), v);
+       // Avoid uninitialized warnings, requires DefaultContructible.
+       typedef typename _Tp::value_type value_type;
+       container.insert(container.begin(), value_type());
+       container.insert(container.begin(), value_type());
       }
   };