aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-03-22 12:33:17 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-03-22 12:33:17 +0000
commit4b74f2b44da5f78d2621f5b7f1c6d774d6d498ac (patch)
treeede034471a8c5ca4df5344f7909efe0ba1598e41
parent0560508e3428977eca05455f74c659e22369bb53 (diff)
downloadgcc-4b74f2b44da5f78d2621f5b7f1c6d774d6d498ac.zip
gcc-4b74f2b44da5f78d2621f5b7f1c6d774d6d498ac.tar.gz
gcc-4b74f2b44da5f78d2621f5b7f1c6d774d6d498ac.tar.bz2
array (array<>::at(size_type) const): Fix version for undefined __EXCEPTIONS.
2012-03-22 Paolo Carlini <paolo.carlini@oracle.com> * include/std/array (array<>::at(size_type) const): Fix version for undefined __EXCEPTIONS. From-SVN: r185689
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/std/array5
2 files changed, 8 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 6eb24d8..a618d2a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/array (array<>::at(size_type) const): Fix version
+ for undefined __EXCEPTIONS.
+
2013-03-21 Andreas Tobler <andreast@fgznet.ch>
* testsuite/23_containers/vector/bool/modifiers/insert/31370.cc:
diff --git a/libstdc++-v3/include/std/array b/libstdc++-v3/include/std/array
index ae7445d..3e17744 100644
--- a/libstdc++-v3/include/std/array
+++ b/libstdc++-v3/include/std/array
@@ -174,8 +174,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const_reference
at(size_type __n) const
{
- return __n < _Nm ?
- _M_instance[__n] : __throw_out_of_range(__N("array::at"));
+ if (__n >= _Nm)
+ std::__throw_out_of_range(__N("array::at"));
+ return _M_instance[__n];
}
#endif