From: Paolo Carlini Date: Mon, 19 Sep 2011 11:52:49 +0000 (+0000) Subject: re PR libstdc++/40856 (numeric_limits not specialized for __int128_t or __uint128_t) X-Git-Tag: upstream/12.2.0~81292 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12bfa8bd29310b40e114f4965d9139e1015ae1df;p=platform%2Fupstream%2Fgcc.git re PR libstdc++/40856 (numeric_limits not specialized for __int128_t or __uint128_t) 2011-09-19 Paolo Carlini PR libstdc++/40856 * include/std/limits (numeric_limits<__int128_t>, numeric_limits<__uint128_t>): Add. * src/limits.cc:Define. * config/abi/pre/gnu.ver: Export. * include/ext/typelist.h (_GLIBCXX_TYPELIST_CHAIN16, 20): Add. * testsuite/util/testsuite_common_types.h (integral_types_gnu): Add (limits_tl): Use it. * testsuite/18_support/numeric_limits/requirements/ constexpr_functions.cc: Likewise. * testsuite/18_support/numeric_limits/40856.cc: New. * testsuite/18_support/numeric_limits/dr559.cc: Extend. * testsuite/18_support/numeric_limits/lowest.cc: Likewise. * testsuite/18_support/numeric_limits/max_digits10.cc: Likewise. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Likewise. From-SVN: r178969 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0416159..98f8b81 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,31 @@ +2011-09-19 Paolo Carlini + + PR libstdc++/40856 + * include/std/limits (numeric_limits<__int128_t>, + numeric_limits<__uint128_t>): Add. + * src/limits.cc:Define. + * config/abi/pre/gnu.ver: Export. + * include/ext/typelist.h (_GLIBCXX_TYPELIST_CHAIN16, 20): Add. + * testsuite/util/testsuite_common_types.h (integral_types_gnu): Add + (limits_tl): Use it. + * testsuite/18_support/numeric_limits/requirements/ + constexpr_functions.cc: Likewise. + * testsuite/18_support/numeric_limits/40856.cc: New. + * testsuite/18_support/numeric_limits/dr559.cc: Extend. + * testsuite/18_support/numeric_limits/lowest.cc: Likewise. + * testsuite/18_support/numeric_limits/max_digits10.cc: Likewise. + * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error + line numbers. + * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. + * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise. + * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise. + * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: + Likewise. + * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: + Likewise. + * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: + Likewise. + 2011-09-17 Paolo Carlini PR libstdc++/50441 diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index bd39245..7409e64 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -500,10 +500,14 @@ GLIBCXX_3.4 { _ZNSt21__numeric_limits_base1[0-7]mi*; _ZNSt21__numeric_limits_base1[0-7]max_e*; - _ZNSt14numeric_limitsI[^g]E[5-9]*; - _ZNSt14numeric_limitsI[^g]E1[0-7][hirt]*; - _ZNSt14numeric_limitsI[^g]E1[0-7]mi*; - _ZNSt14numeric_limitsI[^g]E1[0-7]max_e*; + _ZNSt14numeric_limitsI[a-m]E[5-9]*; + _ZNSt14numeric_limitsI[p-z]E[5-9]*; + _ZNSt14numeric_limitsI[a-m]E1[0-7][hirt]*; + _ZNSt14numeric_limitsI[p-z]E1[0-7][hirt]*; + _ZNSt14numeric_limitsI[a-m]E1[0-7]mi*; + _ZNSt14numeric_limitsI[p-z]E1[0-7]mi*; + _ZNSt14numeric_limitsI[a-m]E1[0-7]max_e*; + _ZNSt14numeric_limitsI[p-z]E1[0-7]max_e*; # std::_Rb_tree _ZSt18_Rb_tree_decrementPKSt18_Rb_tree_node_base; @@ -1185,7 +1189,8 @@ GLIBCXX_3.4.14 { # std::numeric_limits::max_digits10 _ZNSt21__numeric_limits_base12max_digits10E; - _ZNSt14numeric_limitsI[^g]E12max_digits10E; + _ZNSt14numeric_limitsI[a-m]E12max_digits10E; + _ZNSt14numeric_limitsI[p-z]E12max_digits10E; _ZNSt14numeric_limitsID[is]E12max_digits10E; } GLIBCXX_3.4.13; @@ -1292,6 +1297,11 @@ GLIBCXX_3.4.17 { # std::chrono::steady_clock::now() _ZNSt6chrono12steady_clock3nowEv; + + # std::numeric_limits<__int128_t> and <__uint128_t> + _ZNSt14numeric_limitsInE*; + _ZNSt14numeric_limitsIoE*; + } GLIBCXX_3.4.16; # Symbols in the support library (libsupc++) have their own tag. diff --git a/libstdc++-v3/include/ext/typelist.h b/libstdc++-v3/include/ext/typelist.h index 7f94ecd..de9b690 100644 --- a/libstdc++-v3/include/ext/typelist.h +++ b/libstdc++-v3/include/ext/typelist.h @@ -1,6 +1,7 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011 +// 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 @@ -386,6 +387,11 @@ _GLIBCXX_END_NAMESPACE_VERSION #define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::typelist::chain #define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain #define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN16(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN17(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN18(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN19(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18) __gnu_cxx::typelist::chain +#define _GLIBCXX_TYPELIST_CHAIN20(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19) __gnu_cxx::typelist::chain namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits index 907df6b..fe6ee3d 100644 --- a/libstdc++-v3/include/std/limits +++ b/libstdc++-v3/include/std/limits @@ -1399,6 +1399,155 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION = round_toward_zero; }; +#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) + /// numeric_limits<__int128_t> specialization. + template<> + struct numeric_limits<__int128_t> + { + static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; + + static _GLIBCXX_CONSTEXPR __int128_t + min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (__int128_t); } + + static _GLIBCXX_CONSTEXPR __int128_t + max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (__int128_t); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + static constexpr __int128_t + lowest() noexcept { return min(); } +#endif + + static _GLIBCXX_USE_CONSTEXPR int digits + = __glibcxx_digits (__int128_t); + static _GLIBCXX_USE_CONSTEXPR int digits10 + = __glibcxx_digits10 (__int128_t); +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + static constexpr int max_digits10 = 0; +#endif + static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; + static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; + static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; + static _GLIBCXX_USE_CONSTEXPR int radix = 2; + + static _GLIBCXX_CONSTEXPR __int128_t + epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } + + static _GLIBCXX_CONSTEXPR __int128_t + round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } + + static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; + static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; + static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; + static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; + + static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; + static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; + static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; + static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm + = denorm_absent; + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; + + static _GLIBCXX_CONSTEXPR __int128_t + infinity() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__int128_t>(0); } + + static _GLIBCXX_CONSTEXPR __int128_t + quiet_NaN() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__int128_t>(0); } + + static _GLIBCXX_CONSTEXPR __int128_t + signaling_NaN() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__int128_t>(0); } + + static _GLIBCXX_CONSTEXPR __int128_t + denorm_min() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__int128_t>(0); } + + static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; + static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; + static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; + + static _GLIBCXX_USE_CONSTEXPR bool traps + = __glibcxx_integral_traps; + static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; + static _GLIBCXX_USE_CONSTEXPR float_round_style round_style + = round_toward_zero; + }; + + /// numeric_limits<__uint128_t> specialization. + template<> + struct numeric_limits<__uint128_t> + { + static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; + + static _GLIBCXX_CONSTEXPR __uint128_t + min() _GLIBCXX_USE_NOEXCEPT { return 0; } + + static _GLIBCXX_CONSTEXPR __uint128_t + max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (__uint128_t); } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + static constexpr __uint128_t + lowest() noexcept { return min(); } +#endif + + static _GLIBCXX_USE_CONSTEXPR int digits + = __glibcxx_digits (__uint128_t); + static _GLIBCXX_USE_CONSTEXPR int digits10 + = __glibcxx_digits10 (__uint128_t); +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + static constexpr int max_digits10 = 0; +#endif + static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; + static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; + static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; + static _GLIBCXX_USE_CONSTEXPR int radix = 2; + + static _GLIBCXX_CONSTEXPR __uint128_t + epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } + + static _GLIBCXX_CONSTEXPR __uint128_t + round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } + + static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; + static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; + static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; + static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; + + static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; + static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; + static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; + static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm + = denorm_absent; + static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; + + static _GLIBCXX_CONSTEXPR __uint128_t + infinity() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__uint128_t>(0); } + + static _GLIBCXX_CONSTEXPR __uint128_t + quiet_NaN() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__uint128_t>(0); } + + static _GLIBCXX_CONSTEXPR __uint128_t + signaling_NaN() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__uint128_t>(0); } + + static _GLIBCXX_CONSTEXPR __uint128_t + denorm_min() _GLIBCXX_USE_NOEXCEPT + { return static_cast<__uint128_t>(0); } + + static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; + static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; + static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; + + static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; + static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; + static _GLIBCXX_USE_CONSTEXPR float_round_style round_style + = round_toward_zero; + }; +#endif + /// numeric_limits specialization. template<> struct numeric_limits diff --git a/libstdc++-v3/src/limits.cc b/libstdc++-v3/src/limits.cc index 5a21239..a2fe468 100644 --- a/libstdc++-v3/src/limits.cc +++ b/libstdc++-v3/src/limits.cc @@ -1,6 +1,6 @@ // Static data members of -*- C++ -*- numeric_limits classes -// Copyright (C) 1999, 2001, 2002, 2005, 2006, 2009, 2010 +// Copyright (C) 1999, 2001, 2002, 2005, 2006, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -389,6 +389,56 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const bool numeric_limits::tinyness_before; const float_round_style numeric_limits::round_style; +#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) + const bool numeric_limits<__int128_t>::is_specialized; + const int numeric_limits<__int128_t>::digits; + const int numeric_limits<__int128_t>::digits10; + const int numeric_limits<__int128_t>::max_digits10; + const bool numeric_limits<__int128_t>::is_signed; + const bool numeric_limits<__int128_t>::is_integer; + const bool numeric_limits<__int128_t>::is_exact; + const int numeric_limits<__int128_t>::radix; + const int numeric_limits<__int128_t>::min_exponent; + const int numeric_limits<__int128_t>::min_exponent10; + const int numeric_limits<__int128_t>::max_exponent; + const int numeric_limits<__int128_t>::max_exponent10; + const bool numeric_limits<__int128_t>::has_infinity; + const bool numeric_limits<__int128_t>::has_quiet_NaN; + const bool numeric_limits<__int128_t>::has_signaling_NaN; + const float_denorm_style numeric_limits<__int128_t>::has_denorm; + const bool numeric_limits<__int128_t>::has_denorm_loss; + const bool numeric_limits<__int128_t>::is_iec559; + const bool numeric_limits<__int128_t>::is_bounded; + const bool numeric_limits<__int128_t>::is_modulo; + const bool numeric_limits<__int128_t>::traps; + const bool numeric_limits<__int128_t>::tinyness_before; + const float_round_style numeric_limits<__int128_t>::round_style; + + const bool numeric_limits<__uint128_t>::is_specialized; + const int numeric_limits<__uint128_t>::digits; + const int numeric_limits<__uint128_t>::digits10; + const int numeric_limits<__uint128_t>::max_digits10; + const bool numeric_limits<__uint128_t>::is_signed; + const bool numeric_limits<__uint128_t>::is_integer; + const bool numeric_limits<__uint128_t>::is_exact; + const int numeric_limits<__uint128_t>::radix; + const int numeric_limits<__uint128_t>::min_exponent; + const int numeric_limits<__uint128_t>::min_exponent10; + const int numeric_limits<__uint128_t>::max_exponent; + const int numeric_limits<__uint128_t>::max_exponent10; + const bool numeric_limits<__uint128_t>::has_infinity; + const bool numeric_limits<__uint128_t>::has_quiet_NaN; + const bool numeric_limits<__uint128_t>::has_signaling_NaN; + const float_denorm_style numeric_limits<__uint128_t>::has_denorm; + const bool numeric_limits<__uint128_t>::has_denorm_loss; + const bool numeric_limits<__uint128_t>::is_iec559; + const bool numeric_limits<__uint128_t>::is_bounded; + const bool numeric_limits<__uint128_t>::is_modulo; + const bool numeric_limits<__uint128_t>::traps; + const bool numeric_limits<__uint128_t>::tinyness_before; + const float_round_style numeric_limits<__uint128_t>::round_style; +#endif + // float const bool numeric_limits::is_specialized; const int numeric_limits::digits; diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc new file mode 100644 index 0000000..b39456b --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 Free Software Foundation +// +// 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 +// . + +#include + +// libstdc++/40856 +#ifdef _GLIBCXX_USE_INT128 +static_assert(std::numeric_limits<__int128_t>::is_specialized == true, ""); +static_assert(std::numeric_limits<__uint128_t>::is_specialized == true, ""); +#endif diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc index ffe5a4b..d6b78d5 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc @@ -2,7 +2,7 @@ // 2010-02-17 Paolo Carlini // -// Copyright (C) 2010 Free Software Foundation +// Copyright (C) 2010, 2011 Free Software Foundation // // 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 @@ -95,6 +95,11 @@ int main() do_test(); do_test(); do_test(); + // GNU Extensions. +#ifdef _GLIBCXX_USE_INT128 + do_test<__int128_t>(); + do_test<__uint128_t>(); +#endif do_test(); do_test(); do_test(); diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc index 34b603e..ab964ef 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc @@ -72,6 +72,12 @@ void test01() do_test(); do_test(); + // GNU Extensions. +#ifdef _GLIBCXX_USE_INT128 + do_test<__int128_t>(); + do_test<__uint128_t>(); +#endif + do_test(); do_test(); do_test(); diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc index fdce19c..571b403 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc @@ -3,7 +3,7 @@ // 2010-02-25 Ed Smith-Rowland -// Copyright (C) 2010 Free Software Foundation +// Copyright (C) 2010, 2011 Free Software Foundation // // 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 @@ -47,6 +47,12 @@ test01() VERIFY( std::numeric_limits::max_digits10 == 0 ); VERIFY( std::numeric_limits::max_digits10 == 0 ); + // GNU Extensions. +#ifdef _GLIBCXX_USE_INT128 + VERIFY( std::numeric_limits<__int128_t>::max_digits10 == 0 ); + VERIFY( std::numeric_limits<__uint128_t>::max_digits10 == 0 ); +#endif + const int f_max_digits10 = (2 + std::numeric_limits::digits * 643 / 2136); VERIFY( std::numeric_limits::max_digits10 == f_max_digits10 ); diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc index f1848f2..f7ed221 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc @@ -1,7 +1,7 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 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 @@ -65,6 +65,6 @@ int main() __gnu_test::constexpr_member_functions test; __gnu_cxx::typelist::apply_generator(test, __gnu_test::limits_tl(), - __gnu_test::integral_types::type()); + __gnu_test::integral_types_gnu::type()); return 0; } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc index 68b64f0..b2f3f34 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc @@ -28,5 +28,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 572 } +// { dg-error "deleted" "" { target *-*-* } 616 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc index 79182bb..fd506e1 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc @@ -28,5 +28,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 611 } +// { dg-error "deleted" "" { target *-*-* } 655 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc index 306fd4c..aa94cef 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc @@ -29,5 +29,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 572 } +// { dg-error "deleted" "" { target *-*-* } 616 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc index 56a41d1..df705d2 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc @@ -29,5 +29,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 611 } +// { dg-error "deleted" "" { target *-*-* } 655 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc index 5fb4984..f4b4f8f 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc @@ -27,10 +27,10 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 426 } -// { dg-error "deleted" "" { target *-*-* } 427 } -// { dg-error "operator" "" { target *-*-* } 428 } -// { dg-error "operator" "" { target *-*-* } 429 } -// { dg-error "operator" "" { target *-*-* } 430 } +// { dg-error "deleted" "" { target *-*-* } 470 } +// { dg-error "deleted" "" { target *-*-* } 471 } +// { dg-error "operator" "" { target *-*-* } 472 } +// { dg-error "operator" "" { target *-*-* } 473 } +// { dg-error "operator" "" { target *-*-* } 474 } // { dg-prune-output "declared here" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc index 3e0a975..5b31fc0 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc @@ -28,6 +28,6 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 385 } -// { dg-error "operator" "" { target *-*-* } 386 } -// { dg-error "operator" "" { target *-*-* } 387 } +// { dg-error "operator" "" { target *-*-* } 429 } +// { dg-error "operator" "" { target *-*-* } 430 } +// { dg-error "operator" "" { target *-*-* } 431 } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc index 5047be7..9624eef 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc @@ -28,6 +28,6 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 363 } -// { dg-error "operator" "" { target *-*-* } 364 } -// { dg-error "operator" "" { target *-*-* } 365 } +// { dg-error "operator" "" { target *-*-* } 407 } +// { dg-error "operator" "" { target *-*-* } 408 } +// { dg-error "operator" "" { target *-*-* } 409 } diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index a4f59ac..68c3252 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -257,7 +257,7 @@ namespace __gnu_test typedef typename append::type type; }; - // A typelist of all integral types. + // A typelist of all standard integral types. struct integral_types { typedef bool a1; @@ -285,6 +285,50 @@ namespace __gnu_test #endif }; + // A typelist of all standard integral types + the GNU 128-bit types. + struct integral_types_gnu + { + typedef bool a1; + typedef char a2; + typedef signed char a3; + typedef unsigned char a4; + typedef short a5; + typedef unsigned short a6; + typedef int a7; + typedef unsigned int a8; + typedef long a9; + typedef unsigned long a10; + typedef long long a11; + typedef unsigned long long a12; + typedef wchar_t a13; +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + typedef char16_t a14; + typedef char32_t a15; +# if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) + typedef __int128_t a16; + typedef __uint128_t a17; + + typedef node<_GLIBCXX_TYPELIST_CHAIN17(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, + a16, a17)> type; +# else + typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)> type; +# endif +#else +# if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) + typedef __int128_t a14; + typedef __uint128_t a15; + + typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)> type; +# else + typedef node<_GLIBCXX_TYPELIST_CHAIN13(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)> type; +# endif +#endif + }; + #ifdef __GXX_EXPERIMENTAL_CXX0X__ struct atomic_integrals_no_bool { @@ -347,7 +391,7 @@ namespace __gnu_test typedef std::numeric_limits type; }; - typedef transform::type limits_tl; + typedef transform::type limits_tl; struct has_increment_operators {