public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Improve tests for std::add_pointer
@ 2019-10-31 14:07 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2019-10-31 14:07 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

The type trait depends on is_void so the tests should check those cases.

	* testsuite/20_util/add_pointer/value.cc: Check void types.

Tested x86_64-linux, committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1380 bytes --]

commit 5b35f49aeb052513b4580ed4d9ea0ef3118a200d
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Oct 31 14:05:47 2019 +0000

    Improve tests for std::add_pointer
    
    The type trait depends on is_void so the tests should check those cases.
    
            * testsuite/20_util/add_pointer/value.cc: Check void types.

diff --git a/libstdc++-v3/testsuite/20_util/add_pointer/value.cc b/libstdc++-v3/testsuite/20_util/add_pointer/value.cc
index acf9442851f..66d94783c11 100644
--- a/libstdc++-v3/testsuite/20_util/add_pointer/value.cc
+++ b/libstdc++-v3/testsuite/20_util/add_pointer/value.cc
@@ -31,8 +31,14 @@ void test01()
   static_assert(is_same<add_pointer<const int>::type, const int*>::value, "");
   static_assert(is_same<add_pointer<int&>::type, int*>::value, "");
   static_assert(is_same<add_pointer<ClassType*>::type,
-		ClassType**>::value, "");
+			ClassType**>::value, "");
   static_assert(is_same<add_pointer<ClassType>::type, ClassType*>::value, "");
+  static_assert(is_same<add_pointer<void>::type, void*>::value, "");
+  static_assert(is_same<add_pointer<const void>::type, const void*>::value, "");
+  static_assert(is_same<add_pointer<volatile void>::type,
+			volatile void*>::value, "");
+  static_assert(is_same<add_pointer<const volatile void>::type,
+			const volatile void*>::value, "");
 }
 
 void test02()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-31 14:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 14:07 [PATCH] Improve tests for std::add_pointer Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).