diff options
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/exception_ptr.h | 8 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc | 38 |
3 files changed, 51 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 652e589..6129434 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2010-05-07 Jonathan Wakely <jwakely.gcc@gmail.com> + + * libsupc++/exception_ptr.h (make_exception_ptr): Add. + * testsuite/18_support/exception_ptr/make_exception_ptr.cc: New. + 2010-05-06 Jason Merrill <jason@redhat.com> * config/abi/pre/gnu.ver: Move decltype(nullptr) into CXXABI_1.3.5. diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index 3ee4d8d..f3f0819 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -160,6 +160,14 @@ namespace std } } + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 1130. copy_exception name misleading + /// Obtain an exception_ptr pointing to a copy of the supplied object. + template<typename _Ex> + exception_ptr + make_exception_ptr(_Ex __ex) throw() + { return std::copy_exception<_Ex>(__ex); } + // @} group exceptions } // namespace std diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc new file mode 100644 index 0000000..bc16ccd --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/exception_ptr/make_exception_ptr.cc @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-atomic-builtins "" } + +// Copyright (C) 2010 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 3, 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 COPYING3. If not see +// <http://www.gnu.org/licenses/>. + +#include <exception> +#include <testsuite_hooks.h> + +bool test01() +{ + bool test __attribute__((unused)) = true; + + std::exception_ptr p = std::make_exception_ptr(0); + + VERIFY( !(p == 0) ); +} + +int main() +{ + test01(); + + return 0; +} |