aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-11-23 21:35:40 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-11-23 21:39:46 +0000
commitc59ec55c3459fba619e05ee7f59480b71e85ffd7 (patch)
tree2c3c79d9b9b59d1577904de1796e471e8eb45141
parent39de0e541107bc4b0b3b82f613054f59c6821eb5 (diff)
downloadgcc-c59ec55c3459fba619e05ee7f59480b71e85ffd7.zip
gcc-c59ec55c3459fba619e05ee7f59480b71e85ffd7.tar.gz
gcc-c59ec55c3459fba619e05ee7f59480b71e85ffd7.tar.bz2
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.
-rw-r--r--libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
index 637246b..fd50e8b 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;