diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2009-12-10 13:17:56 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-12-10 13:17:56 +0000 |
commit | 790ad3b5b48cfaedebaf3615e09b233e58bad8a0 (patch) | |
tree | b67583d2494fd016aedaf3a709ba8a9990f75481 | |
parent | 58b9c1deb82fcd2c89e47422e5c6fd837e49980b (diff) | |
download | gcc-790ad3b5b48cfaedebaf3615e09b233e58bad8a0.zip gcc-790ad3b5b48cfaedebaf3615e09b233e58bad8a0.tar.gz gcc-790ad3b5b48cfaedebaf3615e09b233e58bad8a0.tar.bz2 |
testsuite_containers.h (populate<>::populate(_Tp&)): Avoid used uninitialized warning.
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/util/testsuite_containers.h | 7 |
3 files changed, 13 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3d9b49a..2297011 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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 diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp index 5711153..24294ad 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp @@ -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();) diff --git a/libstdc++-v3/testsuite/util/testsuite_containers.h b/libstdc++-v3/testsuite/util/testsuite_containers.h index 62bf38f..af07441 100644 --- a/libstdc++-v3/testsuite/util/testsuite_containers.h +++ b/libstdc++-v3/testsuite/util/testsuite_containers.h @@ -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()); } }; |