OSDN Git Service

2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Mar 2012 12:36:01 +0000 (12:36 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Mar 2012 12:36:01 +0000 (12:36 +0000)
* include/std/array (array<>::at(size_type) const): Fix version
for undefined __EXCEPTIONS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@185690 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/array

index 59d90ad..12653d8 100644 (file)
@@ -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.
+
 2012-03-22  Release Manager
 
        * GCC 4.7.0 released.
index ae7445d..8cd5388 100644 (file)
@@ -1,6 +1,7 @@
 // <array> -*- C++ -*-
 
-// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
+// 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
@@ -174,8 +175,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