diff mbox

libstdc++/61532 fix make_signed failures

Message ID 20140623203017.GG8592@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely June 23, 2014, 8:30 p.m. UTC
On 23/06/14 19:18 +0100, Jonathan Wakely wrote:
>This fixes some more fallout from my make_signed<wchar_t> changes and
>improves the make_unsigned tests which were already fixed last month.
>
>Tested x86_64-linux and powerpc64-linux, committed to trunk. I'll be
>making the same changes on the 4.9 branch shortly.

This is the patch for the 4.9 branch, which combines a fix I forgot to
backport (r210517) with today's fix for PR61532.

Tested x86_64-linux, committed to the 4.9 branch.
diff mbox

Patch

commit a00bdfff755b28cb26bf44b87e6accf52bb8008e
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jun 23 21:07:23 2014 +0100

    	PR libstdc++/61532
    	* testsuite/20_util/make_signed/requirements/typedefs-1.cc: Do not
    	apply the signed specifier to wchar_t.
    	* testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise.
    	* testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Do not
    	apply the unsigned specifier to wchar_t.
    	* testsuite/20_util/make_unsigned/requirements/typedefs-2.cc:
    	Likewise.

diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
index e3b84d6..5b094d9 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-1.cc
@@ -29,6 +29,7 @@  void test01()
   using std::make_signed;
   using std::is_same;
   using std::is_signed;
+  using std::is_volatile;
 
   // Positive tests.
   typedef make_signed<const int>::type  	test2_type;
@@ -53,7 +54,9 @@  void test01()
 
 #ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_signed<volatile wchar_t>::type  	test23_type;
-  static_assert( is_same<test23_type, volatile signed wchar_t>::value,
+  static_assert( is_signed<test23_type>::value
+                 && is_volatile<test23_type>::value
+                 && sizeof(test23_type) == sizeof(volatile wchar_t),
                  "make_signed<volatile wchar_t>" );
 #endif
 
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
index 654b375..3f47dba 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
@@ -30,6 +30,8 @@  void test01()
 {
   using std::make_signed;
   using std::is_same;
+  using std::is_signed;
+  using std::is_volatile;
 
   // Positive tests.
   typedef make_signed<const int>::type  	test2_type;
@@ -50,7 +52,9 @@  void test01()
 
 #ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_signed<volatile wchar_t>::type  	test23_type;
-  static_assert(is_same<test23_type, volatile signed wchar_t>::value, "");
+  static_assert(is_signed<test23_type>::value
+                 && is_volatile<test23_type>::value
+                 && sizeof(test23_type) == sizeof(volatile wchar_t), "");
 #endif
 
   typedef make_signed<test_enum>::type  	test24_type;
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
index a893ede..de65504 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc
@@ -29,6 +29,7 @@  void test01()
   using std::make_unsigned;
   using std::is_same;
   using std::is_unsigned;
+  using std::is_volatile;
 
   // Positive tests.
   typedef make_unsigned<const unsigned int>::type  	test2_type;
@@ -49,7 +50,9 @@  void test01()
 
 #ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_unsigned<volatile wchar_t>::type  	test23_type;
-  static_assert(is_same<test23_type, volatile unsigned wchar_t>::value, "");
+  static_assert(is_unsigned<test23_type>::value
+                && is_volatile<test23_type>::value
+                && sizeof(test23_type) == sizeof(volatile wchar_t), "");
 #endif
 
   // Chapter 48, chapter 20. Smallest rank such that new unsigned type
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
index 637b0c7..7801dca 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
@@ -30,6 +30,8 @@  void test01()
 {
   using std::make_unsigned;
   using std::is_same;
+  using std::is_unsigned;
+  using std::is_volatile;
 
   // Positive tests.
   typedef make_unsigned<const unsigned int>::type  	test2_type;
@@ -50,7 +52,9 @@  void test01()
 
 #ifdef _GLIBCXX_USE_WCHAR_T
   typedef make_unsigned<volatile wchar_t>::type  	test23_type;
-  static_assert(is_same<test23_type, volatile unsigned wchar_t>::value, "");
+  static_assert(is_unsigned<test23_type>::value
+                && is_volatile<test23_type>::value
+                && sizeof(test23_type) == sizeof(volatile wchar_t), "");
 #endif
 
   typedef make_unsigned<test_enum>::type  	  test24_type;