summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Quinn <jlquinn@optonline.net>2003-03-06 18:10:26 +0000
committerJerry Quinn <jlquinn@gcc.gnu.org>2003-03-06 18:10:26 +0000
commit53ec7ec1f19f1279b4c035c6950ca0be56559ee0 (patch)
tree8dac2f3c78af236d7bc21a8954c55ad3f22e7531
parent2085604548a23235008474c755b9ac37a413de4d (diff)
downloadgcc-53ec7ec1f19f1279b4c035c6950ca0be56559ee0.tar.gz
ios.cc (ios_base::_M_init): Remove _M_word_size.
2003-03-06 Jerry Quinn <jlquinn@optonline.net> * src/ios.cc (ios_base::_M_init): Remove _M_word_size. (ios_base::ios_base): Set _M_word, _M_word_size. (ios_base::~ios_base): Remove redundant test. * testsuite/27_io/ios_base_storage.cc (test03): New. From-SVN: r63896
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/src/ios.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base_storage.cc15
3 files changed, 25 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ef9b41f0cd5..965a33302df 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2003-03-06 Jerry Quinn <jlquinn@optonline.net>
+
+ * src/ios.cc (ios_base::_M_init): Remove _M_word_size.
+ (ios_base::ios_base): Set _M_word, _M_word_size.
+ (ios_base::~ios_base): Remove redundant test.
+ * testsuite/27_io/ios_base_storage.cc (test03): New.
+
2003-03-04 Alexandre Oliva <aoliva@redhat.com>
* src/strstream.cc, include/bits/basic_string.tcc: Remove
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index 871e836ae9e..f068a299361 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -288,7 +288,6 @@ namespace std
_M_width = 0;
_M_flags = skipws | dec;
_M_callbacks = 0;
- _M_word_size = 0;
_M_ios_locale = locale();
}
@@ -302,7 +301,8 @@ namespace std
return __old;
}
- ios_base::ios_base() : _M_callbacks(0), _M_word(0), _M_locale_cache(0)
+ ios_base::ios_base() : _M_callbacks(0), _M_word(_M_local_word),
+ _M_word_size(_S_local_word_size), _M_locale_cache(0)
{
// Do nothing: basic_ios::init() does it.
// NB: _M_callbacks and _M_word must be zero for non-initialized
@@ -314,7 +314,7 @@ namespace std
{
_M_call_callbacks(erase_event);
_M_dispose_callbacks();
- if (_M_word && _M_word != _M_local_word)
+ if (_M_word != _M_local_word)
{
delete [] _M_word;
_M_word = 0;
diff --git a/libstdc++-v3/testsuite/27_io/ios_base_storage.cc b/libstdc++-v3/testsuite/27_io/ios_base_storage.cc
index a0c174660c4..6af52c0a8c0 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base_storage.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base_storage.cc
@@ -91,10 +91,25 @@ void test02()
VERIFY( l == 0 );
}
+class derived : public std::ios_base
+{
+public:
+ derived() {}
+};
+
+void test03()
+{
+ derived d;
+
+ d.pword(0) = &d;
+ d.iword(0) = 1;
+}
+
int main(void)
{
__gnu_cxx_test::set_memory_limits();
test01();
test02();
+ test03();
return 0;
}