OSDN Git Service

2002-12-16 Paolo Carlini <pcarlini@unitus.it>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Dec 2002 19:52:37 +0000 (19:52 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Dec 2002 19:52:37 +0000 (19:52 +0000)
PR libstdc++/8949
* include/std/std_limits.h
(struct numeric_limits<short>,
struct numeric_limits<unsigned short>,
struct numeric_limits<int>,
struct numeric_limits<unsigned int>,
struct numeric_limits<long>,
struct numeric_limits<unsigned long>,
struct numeric_limits<long long>,
struct numeric_limits<unsigned long long>): According
to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
* testsuite/18_support/numeric_limits.cc: Add test04.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60181 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/std_limits.h
libstdc++-v3/testsuite/18_support/numeric_limits.cc

index 356a580..f8a5ec2 100644 (file)
@@ -1,3 +1,18 @@
+2002-12-16  Paolo Carlini  <pcarlini@unitus.it>
+
+       PR libstdc++/8949
+       * include/std/std_limits.h
+       (struct numeric_limits<short>,
+       struct numeric_limits<unsigned short>,
+       struct numeric_limits<int>,
+       struct numeric_limits<unsigned int>,
+       struct numeric_limits<long>,
+       struct numeric_limits<unsigned long>,
+       struct numeric_limits<long long>,
+       struct numeric_limits<unsigned long long>): According
+       to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
+       * testsuite/18_support/numeric_limits.cc: Add test04.
+
 2002-12-16  Benjamin Kosnik  <bkoz@redhat.com>
 
         * configure.in (GLIBCPP_ENABLE_DEBUG): Default to none.
index be4b5f2..9be6947 100644 (file)
@@ -508,7 +508,7 @@ namespace std
       static short denorm_min() throw()
       { return short(); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
@@ -558,7 +558,7 @@ namespace std
       static unsigned short denorm_min() throw()
       { return static_cast<unsigned short>(0); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
@@ -608,7 +608,7 @@ namespace std
       static int denorm_min() throw()
       { return static_cast<int>(0); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
@@ -658,7 +658,7 @@ namespace std
       static unsigned int denorm_min() throw()
       { return static_cast<unsigned int>(0); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
@@ -708,7 +708,7 @@ namespace std
       static long denorm_min() throw()
       { return static_cast<long>(0); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
@@ -758,7 +758,7 @@ namespace std
       static unsigned long denorm_min() throw()
       { return static_cast<unsigned long>(0); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
@@ -808,7 +808,7 @@ namespace std
       static long long denorm_min() throw()
       { return static_cast<long long>(0); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
@@ -858,7 +858,7 @@ namespace std
       static unsigned long long denorm_min() throw()
       { return static_cast<unsigned long long>(0); }
 
-      static const bool is_iec559 = true;
+      static const bool is_iec559 = false;
       static const bool is_bounded = true;
       static const bool is_modulo = true;
 
index 4a1c498..540b4b7 100644 (file)
@@ -289,12 +289,33 @@ bool test03()
   return test;
 }
 
+// libstdc++/8949
+bool test04()
+{
+  bool test = true;
+
+  VERIFY( !std::numeric_limits<short>::is_iec559 );
+  VERIFY( !std::numeric_limits<unsigned short>::is_iec559 );
+  VERIFY( !std::numeric_limits<int>::is_iec559 );
+  VERIFY( !std::numeric_limits<unsigned int>::is_iec559 );
+  VERIFY( !std::numeric_limits<long>::is_iec559 );
+  VERIFY( !std::numeric_limits<unsigned long>::is_iec559 );
+  VERIFY( !std::numeric_limits<long long>::is_iec559 );
+  VERIFY( !std::numeric_limits<unsigned long long>::is_iec559 );
+
+#ifdef DEBUG_ASSERT
+  assert(test);
+#endif
+
+  return test;
+}
 
 int main()
 {
   test01();
   test02();
   test03();
+  test04();
 
   test_extrema<char>();
   test_extrema<signed char>();