Commit b8d85086 by Jonathan Wakely Committed by Jonathan Wakely

pointer_to.cc: Fix.

2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* testsuite/20_util/pointer_traits/pointer_to.cc: Fix.

From-SVN: r174384
parent 43653c33
2011-05-28 Jonathan Wakely <jwakely.gcc@gmail.com> 2011-05-28 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/20_util/pointer_traits/pointer_to.cc: Fix.
2011-05-28 Jonathan Wakely <jwakely.gcc@gmail.com>
* acinclude.m4: Define GLIBCXX_CHECK_GET_NPROCS and * acinclude.m4: Define GLIBCXX_CHECK_GET_NPROCS and
GLIBCXX_CHECK_SC_NPROCESSORS_ONLN. GLIBCXX_CHECK_SC_NPROCESSORS_ONLN.
* configure.ac: Use them. Increase minor version. * configure.ac: Use them. Increase minor version.
......
...@@ -24,15 +24,17 @@ ...@@ -24,15 +24,17 @@
struct Ptr struct Ptr
{ {
typedef bool element_type; typedef bool element_type;
bool* value;
static bool* pointer_to(bool& b) { return 0; } static Ptr pointer_to(bool& b) { return Ptr{&b}; }
}; };
void test01() void test01()
{ {
bool test = true; bool test = true;
Ptr p{&test};
VERIFY( std::pointer_traits<Ptr>::pointer_to(test) == 0 ); VERIFY( std::pointer_traits<Ptr>::pointer_to(test).value == &test );
} }
void test02() void test02()
......
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