public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-9275] libstdc++: Add another testcase for std::unique_ptr printer [PR103086]
Date: Wed, 24 Nov 2021 11:50:06 +0000 (GMT)	[thread overview]
Message-ID: <20211124115006.3AE0C3858C27@sourceware.org> (raw)

https://gcc.gnu.org/g:fa1ea255dba2d44ff22e434ed3d7778e8aaf4b91

commit r11-9275-gfa1ea255dba2d44ff22e434ed3d7778e8aaf4b91
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Nov 23 21:35:40 2021 +0000

    libstdc++: Add another testcase for std::unique_ptr printer [PR103086]
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/103086
            * testsuite/libstdc++-prettyprinters/cxx11.cc: Check unique_ptr
            with non-empty pointer and non-empty deleter.
    
    (cherry picked from commit c59ec55c3459fba619e05ee7f59480b71e85ffd7)

Diff:
---
 libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
index 637246b3c12..fd50e8b028a 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
@@ -151,6 +151,17 @@ main()
   std::unique_ptr<int, Deleter>& rempty_ptr = empty_ptr;
 // { dg-final { note-test rempty_ptr {std::unique_ptr<int> = {get() = {<No data fields>}}} } }
 
+  struct Deleter_pr103086
+  {
+    int deleter_member = -1;
+    void operator()(int*) const noexcept { }
+  };
+
+  std::unique_ptr<int, Deleter_pr103086> uniq_ptr;
+// { dg-final { note-test uniq_ptr {std::unique_ptr<int> = {get() = 0x0}} } }
+  std::unique_ptr<int, Deleter_pr103086>& runiq_ptr = uniq_ptr;
+// { dg-final { note-test runiq_ptr {std::unique_ptr<int> = {get() = 0x0}} } }
+
   ExTuple tpl(6,7);
 // { dg-final { note-test tpl {std::tuple containing = {[1] = 6, [2] = 7}} } }
   ExTuple &rtpl = tpl;


                 reply	other threads:[~2021-11-24 11:50 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=20211124115006.3AE0C3858C27@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).