public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [PATCH] Improve tests for std::add_pointer
Date: Thu, 31 Oct 2019 14:07:00 -0000	[thread overview]
Message-ID: <20191031140706.GA3831@redhat.com> (raw)

[-- 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()

                 reply	other threads:[~2019-10-31 14:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191031140706.GA3831@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).