re PR libstdc++/56609 ([C++11] Several type traits give incorrect results for std::nullptr_t)

2013-03-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/56609
	* include/std/type_traits (is_fundamental): Add std::nullptr_t.
	* testsuite/20_util/is_fundamental/value.cc: Extend.
	* testsuite/20_util/is_compound/value.cc: Likewise.

From-SVN: r196630
This commit is contained in:
Paolo Carlini 2013-03-13 11:15:45 +00:00 committed by Paolo Carlini
parent 1bfa59736a
commit 8a38ebb653
4 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2013-03-13 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/56609
* include/std/type_traits (is_fundamental): Add std::nullptr_t.
* testsuite/20_util/is_fundamental/value.cc: Extend.
* testsuite/20_util/is_compound/value.cc: Likewise.
2013-03-09 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/20_util/function_objects/mem_fn/55463.cc: Avoid

View File

@ -444,7 +444,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// is_fundamental
template<typename _Tp>
struct is_fundamental
: public __or_<is_arithmetic<_Tp>, is_void<_Tp>>::type
: public __or_<is_arithmetic<_Tp>, is_void<_Tp>, __is_nullptr_t<_Tp>>::type
{ };
/// is_object

View File

@ -46,6 +46,9 @@ void test01()
VERIFY( (test_category<is_compound, double>(false)) );
VERIFY( (test_category<is_compound, long double>(false)) );
// libstdc++/56609
VERIFY( (test_category<is_compound, std::nullptr_t>(false)) );
// Sanity check.
VERIFY( (test_category<is_compound, ClassType>(true)) );
}

View File

@ -46,6 +46,9 @@ void test01()
VERIFY( (test_category<is_fundamental, double>(true)) );
VERIFY( (test_category<is_fundamental, long double>(true)) );
// libstdc++/56609
VERIFY( (test_category<is_fundamental, std::nullptr_t>(true)) );
// Sanity check.
VERIFY( (test_category<is_fundamental, ClassType>(false)) );
}