exception_ptr.h (make_exception_ptr): Add.

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.

From-SVN: r159144
This commit is contained in:
Jonathan Wakely 2010-05-07 01:05:38 +00:00 committed by Jonathan Wakely
parent a26cd6b8bd
commit bb9c865802
3 changed files with 51 additions and 0 deletions

View File

@ -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.

View File

@ -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

View File

@ -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;
}