Commit e80d3fda by Akira Takahashi Committed by Paolo Carlini

re PR libstdc++/53515 (InputIterator version std::advance needs negative check)

2012-09-26  Akira Takahashi  <faithandbrave@gmail.com>

	PR libstdc++/53515
	* include/bits/stl_iterator_base_funcs.h (__advance(_InputIterator&,
	_Distance, input_iterator_tag)): Add _GLIBCXX_DEBUG_ASSERT(__n >= 0).

From-SVN: r191784
parent ef13e9de
2012-09-26 Akira Takahashi <faithandbrave@gmail.com>
PR libstdc++/53515
* include/bits/stl_iterator_base_funcs.h (__advance(_InputIterator&,
_Distance, input_iterator_tag)): Add _GLIBCXX_DEBUG_ASSERT(__n >= 0).
2012-09-26 Ulrich Drepper <drepper@gmail.com> 2012-09-26 Ulrich Drepper <drepper@gmail.com>
Optimize bulk mode for normal_distribution<double> for SSE3. Optimize bulk mode for normal_distribution<double> for SSE3.
......
// Functions used by iterators -*- C++ -*- // Functions used by iterators -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 // Copyright (C) 2001-2012 Free Software Foundation, Inc.
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -63,6 +62,7 @@ ...@@ -63,6 +62,7 @@
#pragma GCC system_header #pragma GCC system_header
#include <bits/concept_check.h> #include <bits/concept_check.h>
#include <debug/debug.h>
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
...@@ -124,6 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -124,6 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
// concept requirements // concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>) __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
_GLIBCXX_DEBUG_ASSERT(__n >= 0);
while (__n--) while (__n--)
++__i; ++__i;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment