summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-17 15:17:32 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-17 15:17:32 +0000
commitdf6bf909abc7b296d166941c3c83b55f5c826c6c (patch)
treef519470139721610686b4f76c385abe5dc074060 /libstdc++-v3/testsuite
parent59bc01b3c5f339a2710c884305f0354f5c1df327 (diff)
downloadgcc-df6bf909abc7b296d166941c3c83b55f5c826c6c.tar.gz
2006-10-17 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/26020 * include/bits/stl_iterator_base_funcs.h (advance): Convert distance parameter to iterator_traits<>::difference_type. * testsuite/24_iterators/26020.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117827 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r--libstdc++-v3/testsuite/24_iterators/26020.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/24_iterators/26020.cc b/libstdc++-v3/testsuite/24_iterators/26020.cc
new file mode 100644
index 00000000000..80c4e715d1b
--- /dev/null
+++ b/libstdc++-v3/testsuite/24_iterators/26020.cc
@@ -0,0 +1,45 @@
+// Copyright (C) 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// 24.3.4 Iterator operations
+
+#include <iterator>
+#include <list>
+#include <testsuite_hooks.h>
+
+//libstdc++/26020
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ list<int> ll;
+ ll.push_back(1);
+
+ list<int>::iterator it(ll.begin());
+
+ advance(it, 0.5);
+
+ VERIFY( it == ll.begin() );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}