OSDN Git Service

2008-05-05 Benjamin Kosnik <bkoz@redhat.com>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 May 2008 17:16:44 +0000 (17:16 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 May 2008 17:16:44 +0000 (17:16 +0000)
* 20_util/make_signed/requirements/typedefs-1.cc: Correct requirements.
* 20_util/make_unsigned/requirements/typedefs-1.cc: Same.

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

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc

index 3ceb05a..864a580 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-05  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * 20_util/make_signed/requirements/typedefs-1.cc: Correct requirements.
+       * 20_util/make_unsigned/requirements/typedefs-1.cc: Same.
+
 2008-05-01  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/bits/c++config: Revert _GLIBCXX_LONG_DOUBLE_COMPAT change.
index 0dea4ca..519eb47 100644 (file)
@@ -2,7 +2,7 @@
 
 // 2007-05-03  Benjamin Kosnik  <bkoz@redhat.com>
 //
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 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
@@ -30,6 +30,7 @@ void test01()
   bool test __attribute__((unused)) = true;
   using std::make_signed;
   using std::is_same;
+  using std::is_signed;
 
   // Positive tests.
   typedef make_signed<const int>::type         test2_type;
@@ -52,8 +53,10 @@ void test01()
   VERIFY( (is_same<test23_type, volatile signed wchar_t>::value) );
 #endif
 
+  // Chapter 48, chapter 20. Smallest rank such that new signed type same size.
   typedef make_signed<test_enum>::type         test25_type;
-  VERIFY( (is_same<test25_type, int>::value) );
+  VERIFY( is_signed<test25_type>::value );
+  VERIFY( sizeof(test25_type) == sizeof(test_enum) );
 }
 
 int main()
index ead941c..8e774f4 100644 (file)
@@ -2,7 +2,7 @@
 
 // 2007-05-03  Benjamin Kosnik  <bkoz@redhat.com>
 //
-// Copyright (C) 2007 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008 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
@@ -30,6 +30,7 @@ void test01()
   bool test __attribute__((unused)) = true;
   using std::make_unsigned;
   using std::is_same;
+  using std::is_unsigned;
 
   // Positive tests.
   typedef make_unsigned<const unsigned int>::type      test2_type;
@@ -52,8 +53,11 @@ void test01()
   VERIFY( (is_same<test23_type, volatile wchar_t>::value) );
 #endif
 
+  // Chapter 48, chapter 20. Smallest rank such that new unsigned type
+  // same size.
   typedef make_unsigned<test_enum>::type       test25_type;
-  VERIFY( (is_same<test25_type, unsigned int>::value) );
+  VERIFY( is_unsigned<test25_type>::value );
+  VERIFY( sizeof(test25_type) == sizeof(test_enum) );
 }
 
 int main()