]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add another testcase for std::unique_ptr printer [PR103086]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Nov 2021 21:35:40 +0000 (21:35 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 5 Jan 2022 17:53:37 +0000 (17:53 +0000)
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)

libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc

index d66df64285fb49b34e4b1f5e9fc2c1b2e4507dc4..b03f8479d355e90c5e4f63d070f313920b5991b1 100644 (file)
@@ -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;