aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2003-11-24 21:02:39 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2003-11-24 21:02:39 +0000
commite0ec69c929263d757b83289e79a4236d4951351a (patch)
treee3abf274fe266111d744c5e3998e433a2f43a278
parent21b807f18020f6f10753b0a0ab7d53a65f31b79a (diff)
downloadgcc-e0ec69c929263d757b83289e79a4236d4951351a.zip
gcc-e0ec69c929263d757b83289e79a4236d4951351a.tar.gz
gcc-e0ec69c929263d757b83289e79a4236d4951351a.tar.bz2
streambuf_iterator.h (ostreambuf_iterator): Remove non-standard throw specs.
2003-11-24 Benjamin Kosnik <bkoz@redhat.com> * include/bits/streambuf_iterator.h (ostreambuf_iterator): Remove non-standard throw specs. * testsuite/24_iterators/istreambuf_iterator.cc: Split into... * testsuite/24_iterators/istreambuf_iterator/1.cc * testsuite/24_iterators/istreambuf_iterator/2.cc * testsuite/24_iterators/istreambuf_iterator/2627.cc * testsuite/24_iterators/ostreambuf_iterator.cc: Split into... * testsuite/24_iterators/ostreambuf_iterator/1.cc * testsuite/24_iterators/ostreambuf_iterator/2.cc * testsuite/24_iterators/reverse_iterator/1.cc: Just compile, don't link. * include/bits/allocator.h: Formatting tweak. From-SVN: r73892
-rw-r--r--libstdc++-v3/ChangeLog17
-rw-r--r--libstdc++-v3/include/bits/allocator.h6
-rw-r--r--libstdc++-v3/include/bits/streambuf_iterator.h6
-rw-r--r--libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/1.cc52
-rw-r--r--libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2.cc (renamed from libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc)64
-rw-r--r--libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2627.cc67
-rw-r--r--libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/1.cc50
-rw-r--r--libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/2.cc (renamed from libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc)26
-rw-r--r--libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc7
9 files changed, 194 insertions, 101 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0699b61..9ff983e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,20 @@
+2003-11-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/streambuf_iterator.h (ostreambuf_iterator): Remove
+ non-standard throw specs.
+ * testsuite/24_iterators/istreambuf_iterator.cc: Split into...
+ * testsuite/24_iterators/istreambuf_iterator/1.cc
+ * testsuite/24_iterators/istreambuf_iterator/2.cc
+ * testsuite/24_iterators/istreambuf_iterator/2627.cc
+ * testsuite/24_iterators/ostreambuf_iterator.cc: Split into...
+ * testsuite/24_iterators/ostreambuf_iterator/1.cc
+ * testsuite/24_iterators/ostreambuf_iterator/2.cc
+
+ * testsuite/24_iterators/reverse_iterator/1.cc: Just compile,
+ don't link.
+
+ * include/bits/allocator.h: Formatting tweak.
+
2003-11-24 Paolo Carlini <pcarlini@suse.de>
* src/locale_init.cc: Cosmetic reformatting.
diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h
index a5bcaf5..9d01b7e 100644
--- a/libstdc++-v3/include/bits/allocator.h
+++ b/libstdc++-v3/include/bits/allocator.h
@@ -172,9 +172,11 @@ namespace std
size_type
max_size() const throw() { return size_t(-1) / sizeof(_Tp); }
- void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
+ void
+ construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
- void destroy(pointer __p) { __p->~_Tp(); }
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
};
template<>
diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h
index d193de2..3c393e3 100644
--- a/libstdc++-v3/include/bits/streambuf_iterator.h
+++ b/libstdc++-v3/include/bits/streambuf_iterator.h
@@ -207,15 +207,15 @@ namespace std
}
ostreambuf_iterator&
- operator*() throw()
+ operator*()
{ return *this; }
ostreambuf_iterator&
- operator++(int) throw()
+ operator++(int)
{ return *this; }
ostreambuf_iterator&
- operator++() throw()
+ operator++()
{ return *this; }
bool
diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/1.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/1.cc
new file mode 100644
index 0000000..8c836e5
--- /dev/null
+++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/1.cc
@@ -0,0 +1,52 @@
+// { dg-do compile }
+// 1999-06-28 bkoz
+
+// Copyright (C) 1999, 2001, 2003 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 24.5.3 template class istreambuf_iterator
+
+#include <sstream>
+#include <iterator>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+
+ // Check for required base class.
+ typedef istreambuf_iterator<char> test_iterator;
+ typedef char_traits<char>::off_type off_type;
+ typedef iterator<input_iterator_tag, char, off_type, char*, char&> base_iterator;
+
+ istringstream isstream("this tag");
+ test_iterator r_it(isstream);
+ base_iterator* base __attribute__((unused)) = &r_it;
+
+ // Check for required typedefs
+ typedef test_iterator::value_type value_type;
+ typedef test_iterator::difference_type difference_type;
+ typedef test_iterator::pointer pointer;
+ typedef test_iterator::reference reference;
+ typedef test_iterator::iterator_category iteratory_category;
+
+ typedef test_iterator::char_type char_type;
+ typedef test_iterator::traits_type traits_type;
+ typedef test_iterator::istream_type istream_type;
+ typedef test_iterator::streambuf_type streambuf_type;
+}
diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2.cc
index 8683de6..61c88ea 100644
--- a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
+++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2.cc
@@ -24,32 +24,6 @@
#include <iterator>
#include <testsuite_hooks.h>
-void test01()
-{
- using namespace std;
-
- // Check for required base class.
- typedef istreambuf_iterator<char> test_iterator;
- typedef char_traits<char>::off_type off_type;
- typedef iterator<input_iterator_tag, char, off_type, char*, char&> base_iterator;
-
- istringstream isstream("this tag");
- test_iterator r_it(isstream);
- base_iterator* base __attribute__((unused)) = &r_it;
-
- // Check for required typedefs
- typedef test_iterator::value_type value_type;
- typedef test_iterator::difference_type difference_type;
- typedef test_iterator::pointer pointer;
- typedef test_iterator::reference reference;
- typedef test_iterator::iterator_category iteratory_category;
-
- typedef test_iterator::char_type char_type;
- typedef test_iterator::traits_type traits_type;
- typedef test_iterator::istream_type istream_type;
- typedef test_iterator::streambuf_type streambuf_type;
-}
-
bool test02(void)
{
@@ -136,46 +110,8 @@ bool test02(void)
return test;
}
-// libstdc++/2627
-void test03()
-{
- bool test __attribute__((unused)) = true;
- const std::string s("free the vieques");
-
- // 1
- std::string res_postfix;
- std::istringstream iss01(s);
- std::istreambuf_iterator<char> isbufit01(iss01);
- for (std::size_t j = 0; j < s.size(); ++j, isbufit01++)
- res_postfix += *isbufit01;
-
- // 2
- std::string res_prefix;
- std::istringstream iss02(s);
- std::istreambuf_iterator<char> isbufit02(iss02);
- for (std::size_t j = 0; j < s.size(); ++j, ++isbufit02)
- res_prefix += *isbufit02;
-
- // 3 mixed
- std::string res_mixed;
- std::istringstream iss03(s);
- std::istreambuf_iterator<char> isbufit03(iss03);
- for (std::size_t j = 0; j < (s.size() / 2); ++j)
- {
- res_mixed += *isbufit03;
- ++isbufit03;
- res_mixed += *isbufit03;
- isbufit03++;
- }
-
- VERIFY ( res_postfix == res_prefix );
- VERIFY ( res_mixed == res_prefix );
-}
-
int main()
{
- test01();
test02();
- test03();
return 0;
}
diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2627.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2627.cc
new file mode 100644
index 0000000..ad6d039
--- /dev/null
+++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2627.cc
@@ -0,0 +1,67 @@
+// 1999-06-28 bkoz
+
+// Copyright (C) 1999, 2001, 2003 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 24.5.3 template class istreambuf_iterator
+
+#include <sstream>
+#include <iterator>
+#include <testsuite_hooks.h>
+
+// libstdc++/2627
+void test03()
+{
+ bool test __attribute__((unused)) = true;
+ const std::string s("free the vieques");
+
+ // 1
+ std::string res_postfix;
+ std::istringstream iss01(s);
+ std::istreambuf_iterator<char> isbufit01(iss01);
+ for (std::size_t j = 0; j < s.size(); ++j, isbufit01++)
+ res_postfix += *isbufit01;
+
+ // 2
+ std::string res_prefix;
+ std::istringstream iss02(s);
+ std::istreambuf_iterator<char> isbufit02(iss02);
+ for (std::size_t j = 0; j < s.size(); ++j, ++isbufit02)
+ res_prefix += *isbufit02;
+
+ // 3 mixed
+ std::string res_mixed;
+ std::istringstream iss03(s);
+ std::istreambuf_iterator<char> isbufit03(iss03);
+ for (std::size_t j = 0; j < (s.size() / 2); ++j)
+ {
+ res_mixed += *isbufit03;
+ ++isbufit03;
+ res_mixed += *isbufit03;
+ isbufit03++;
+ }
+
+ VERIFY ( res_postfix == res_prefix );
+ VERIFY ( res_mixed == res_prefix );
+}
+
+int main()
+{
+ test03();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/1.cc b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/1.cc
new file mode 100644
index 0000000..d654d60
--- /dev/null
+++ b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/1.cc
@@ -0,0 +1,50 @@
+// { dg-do compile }
+// 2001-04-30 Benjamin Kosnik <bkoz@redhat.com>
+
+// Copyright (C) 2001, 2003 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 24.5.4 template class ostreambuf_iterator
+
+#include <sstream>
+#include <iterator>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+
+ // Check for required base class.
+ typedef ostreambuf_iterator<char> test_iterator;
+ typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+ ostringstream osstream("this tag");
+ test_iterator r_it(osstream);
+ base_iterator* base __attribute__((unused)) = &r_it;
+
+ // Check for required typedefs
+ typedef test_iterator::value_type value_type;
+ typedef test_iterator::difference_type difference_type;
+ typedef test_iterator::pointer pointer;
+ typedef test_iterator::reference reference;
+ typedef test_iterator::iterator_category iteratory_category;
+
+ typedef test_iterator::char_type char_type;
+ typedef test_iterator::traits_type traits_type;
+ typedef test_iterator::ostream_type ostream_type;
+ typedef test_iterator::streambuf_type streambuf_type;
+}
diff --git a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/2.cc
index 3bc6bbb..f294174 100644
--- a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
+++ b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/2.cc
@@ -24,30 +24,6 @@
#include <iterator>
#include <testsuite_hooks.h>
-void test01()
-{
- using namespace std;
-
- // Check for required base class.
- typedef ostreambuf_iterator<char> test_iterator;
- typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
- ostringstream osstream("this tag");
- test_iterator r_it(osstream);
- base_iterator* base __attribute__((unused)) = &r_it;
-
- // Check for required typedefs
- typedef test_iterator::value_type value_type;
- typedef test_iterator::difference_type difference_type;
- typedef test_iterator::pointer pointer;
- typedef test_iterator::reference reference;
- typedef test_iterator::iterator_category iteratory_category;
-
- typedef test_iterator::char_type char_type;
- typedef test_iterator::traits_type traits_type;
- typedef test_iterator::ostream_type ostream_type;
- typedef test_iterator::streambuf_type streambuf_type;
-}
-
bool test02(void)
{
typedef std::ostreambuf_iterator<char> costreambuf_iter;
@@ -111,8 +87,6 @@ bool test02(void)
int main()
{
- test01();
test02();
-
return 0;
}
diff --git a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc
index 2852d87..d6b088e 100644
--- a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc
+++ b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc
@@ -1,3 +1,4 @@
+// { dg-do compile }
// 2001-06-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -48,9 +49,3 @@ void test01()
// Make sure iterator can be instantiated.
template class std::reverse_iterator<int*>;
-
-int main()
-{
- test01();
- return 0;
-}