From 6a4b1a00fa29aa4f153071a8a663be4379cc75b9 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 22 Apr 2013 15:27:54 +0000 Subject: [PATCH] type_traits (is_signed): Simplify. 2013-04-22 Paolo Carlini * include/std/type_traits (is_signed): Simplify. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error line numbers. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. From-SVN: r198144 --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/std/type_traits | 11 +++-------- .../testsuite/20_util/declval/requirements/1_neg.cc | 2 +- .../20_util/make_signed/requirements/typedefs_neg.cc | 4 ++-- .../make_unsigned/requirements/typedefs_neg.cc | 4 ++-- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ff956355d2e4..10313636b822 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2013-04-22 Paolo Carlini + + * include/std/type_traits (is_signed): Simplify. + * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: + Adjust dg-error line numbers. + * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: + Likewise. + * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. + 2013-04-22 Paolo Carlini N3669 diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 5bff0ab59591..79a9b6ae6903 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -538,18 +538,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { }; template::value, - bool = is_floating_point<_Tp>::value> + bool = is_arithmetic<_Tp>::value> struct __is_signed_helper : public false_type { }; template - struct __is_signed_helper<_Tp, false, true> - : public true_type { }; - - template - struct __is_signed_helper<_Tp, true, false> - : public integral_constant(_Tp(-1) < _Tp(0))> + struct __is_signed_helper<_Tp, true> + : public integral_constant { }; /// is_signed diff --git a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc index 348964aa7829..02347d1685e0 100644 --- a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc +++ b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc @@ -19,7 +19,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-error "static assertion failed" "" { target *-*-* } 1857 } +// { dg-error "static assertion failed" "" { target *-*-* } 1852 } #include diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc index 7da7d1d4fef9..b2d5d770e63a 100644 --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc @@ -48,5 +48,5 @@ void test01() // { dg-error "required from here" "" { target *-*-* } 40 } // { dg-error "required from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1599 } -// { dg-error "declaration of" "" { target *-*-* } 1563 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1594 } +// { dg-error "declaration of" "" { target *-*-* } 1558 } diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc index c769aa9a54c7..8980fe1ba8f1 100644 --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc @@ -48,5 +48,5 @@ void test01() // { dg-error "required from here" "" { target *-*-* } 40 } // { dg-error "required from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1517 } -// { dg-error "declaration of" "" { target *-*-* } 1481 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1512 } +// { dg-error "declaration of" "" { target *-*-* } 1476 }