]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/40856 (numeric_limits not specialized for __int128_t or __uint128_t)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 19 Sep 2011 11:52:49 +0000 (11:52 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 19 Sep 2011 11:52:49 +0000 (11:52 +0000)
2011-09-19  Paolo Carlini  <paolo.carlini@oracle.com>

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

18 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/include/ext/typelist.h
libstdc++-v3/include/std/limits
libstdc++-v3/src/limits.cc
libstdc++-v3/testsuite/18_support/numeric_limits/40856.cc [new file with mode: 0644]
libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc
libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc
libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc
libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc
libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc
libstdc++-v3/testsuite/util/testsuite_common_types.h

index 04161592a6a4c24fe4e3a3a0071393b3274ca11a..98f8b81a482cec85217be2021ab30d4718a9c350 100644 (file)
@@ -1,3 +1,31 @@
+2011-09-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       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  <paolo.carlini@oracle.com>
 
        PR libstdc++/50441
index bd3924569508d6ba6b38f9c891d8119dcc1d6e27..7409e64f9d5c4fda153709ebad4fc36d95905cb6 100644 (file)
@@ -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.
index 7f94ecd728235f4421103b1933e74134db932527..de9b69048b1f8184fdfd6318c019e540642bdb40 100644 (file)
@@ -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<X0, _GLIBCXX_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) >
 #define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) >
 #define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) >
+#define _GLIBCXX_TYPELIST_CHAIN16(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN15(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15) >
+#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<X0, _GLIBCXX_TYPELIST_CHAIN16(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16) >
+#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<X0, _GLIBCXX_TYPELIST_CHAIN17(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17) >
+#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<X0, _GLIBCXX_TYPELIST_CHAIN18(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18) >
+#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<X0, _GLIBCXX_TYPELIST_CHAIN19(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19) >
 
 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
 {
index 907df6b8d5306f095d083f06f9f96473328ffd34..fe6ee3da6eef6da51d2129d9e01a2819e68fbef1 100644 (file)
@@ -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<float> specialization.
   template<>
     struct numeric_limits<float>
index 5a21239d1bcabca87700c1eb595f70e3a7064a24..a2fe468eca9b22e3313ed0db55e0d4cfd8b2f67d 100644 (file)
@@ -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<unsigned long long>::tinyness_before;
   const float_round_style numeric_limits<unsigned long long>::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<float>::is_specialized;
   const int  numeric_limits<float>::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 (file)
index 0000000..b39456b
--- /dev/null
@@ -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
+// <http://www.gnu.org/licenses/>.
+
+#include <limits>
+
+// 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
index ffe5a4ba0dc0b1a424c2612a3e51100460bbc9cb..d6b78d52c90a680205f48710ca8480984c36a27a 100644 (file)
@@ -2,7 +2,7 @@
 
 // 2010-02-17  Paolo Carlini  <paolo.carlini@oracle.com>
 //
-// 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<unsigned long>();
   do_test<long long>();
   do_test<unsigned long long>();
+  // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+  do_test<__int128_t>();
+  do_test<__uint128_t>();
+#endif
   do_test<float>();
   do_test<double>();
   do_test<long double>();
index 34b603e16ba0f921df5b5a42b5583045fe29d8ee..ab964ef98b99a7b9e2c931b6c3ff64e1318c038d 100644 (file)
@@ -72,6 +72,12 @@ void test01()
   do_test<long long>();
   do_test<unsigned long long>();
 
+  // GNU Extensions.
+#ifdef _GLIBCXX_USE_INT128
+  do_test<__int128_t>();
+  do_test<__uint128_t>();
+#endif
+
   do_test<float>();
   do_test<double>();
   do_test<long double>();
index fdce19c36cb917644087900532f43aa59e3ff95b..571b4032b005920a5ea077a58a773e3ba9e12c81 100644 (file)
@@ -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<char16_t>::max_digits10 == 0 );
   VERIFY( std::numeric_limits<char32_t>::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<float>::digits
                              * 643 / 2136);
   VERIFY( std::numeric_limits<float>::max_digits10 == f_max_digits10 );
index f1848f218c2927d6776b7c5ca0b936b0aef100ae..f7ed2216e75dd56f940339b3d2bc7c415927adc5 100644 (file)
@@ -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;
 }
index 68b64f020c24b499011f5b3ac7ff7072a46b4249..b2f3f3418bf14da93097af8ce537c05e748c5560 100644 (file)
@@ -28,5 +28,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 572 }
+// { dg-error "deleted" "" { target *-*-* } 616 }
 // { dg-prune-output "include" }
index 79182bba34062760853f9498e64fe748a9414a13..fd506e1b3dc280059098b8662eda40387dc341ec 100644 (file)
@@ -28,5 +28,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 611 }
+// { dg-error "deleted" "" { target *-*-* } 655 }
 // { dg-prune-output "include" }
index 306fd4c8908030f42818092546c43302e6cb7366..aa94cef59e4015d08114562f867192764d73c3b3 100644 (file)
@@ -29,5 +29,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 572 }
+// { dg-error "deleted" "" { target *-*-* } 616 }
 // { dg-prune-output "include" }
index 56a41d1f2ce3985a02d0a293f4e537e02b973402..df705d29b41e8fce361ffdc4a9736bbc57dd3317 100644 (file)
@@ -29,5 +29,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 611 }
+// { dg-error "deleted" "" { target *-*-* } 655 }
 // { dg-prune-output "include" }
index 5fb4984bf0bdbdcf792012698cb4602e637832e9..f4b4f8fd0cc14219dade3dcecfad9bacff3528a8 100644 (file)
@@ -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" }
index 3e0a97578f514503ace25275f6a0638114ad1e2b..5b31fc0fe7a00242cb5b6f8a5d2821455eb06c20 100644 (file)
@@ -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 }
index 5047be798764f3a5527d4658190ace2005c4c379..9624eefe09224adbc253f186a8daf7dffb37511e 100644 (file)
@@ -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 }
index a4f59ac2ab45fe1b4420df7e4ae3f6df0aa30df6..68c3252472b5d15e7e9fbd1235dbaba2337e6f46 100644 (file)
@@ -257,7 +257,7 @@ namespace __gnu_test
       typedef typename append<a1, a2>::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<value_type>  type;
     };
 
-  typedef transform<integral_types::type, numeric_limits>::type limits_tl;
+  typedef transform<integral_types_gnu::type, numeric_limits>::type limits_tl;
 
   struct has_increment_operators
   {