]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xmethods.py (UniquePtrMethodsMatcher): Add operator-> support.
authorDoug Evans <dje@google.com>
Tue, 26 May 2015 23:06:55 +0000 (23:06 +0000)
committerDoug Evans <devans@gcc.gnu.org>
Tue, 26 May 2015 23:06:55 +0000 (23:06 +0000)
* python/libstdcxx/v6/xmethods.py (UniquePtrMethodsMatcher): Add
operator-> support.
* testsuite/libstdc++-xmethods/unique_ptr.cc: Add tests for
operator->.

From-SVN: r223723

libstdc++-v3/ChangeLog
libstdc++-v3/python/libstdcxx/v6/xmethods.py
libstdc++-v3/testsuite/libstdc++-xmethods/unique_ptr.cc

index af08a735d11d107ed949aac436df7c441d00758f..fa3963d1998997ba4ffb7df7d40c7f19c9acc2a6 100644 (file)
@@ -1,3 +1,10 @@
+2015-05-26  Doug Evans  <dje@google.com>
+
+       * python/libstdcxx/v6/xmethods.py (UniquePtrMethodsMatcher): Add
+       operator-> support.
+       * testsuite/libstdc++-xmethods/unique_ptr.cc: Add tests for
+       operator->.
+
 2015-05-26  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/bits/locale_conv.h: Fix copyright years.
index 6db0e163e9835d3f7bd239147b4791c67353bd6c..c85dd6747345792858c1170ae8bc8eb1a6fb35b8 100644 (file)
@@ -584,6 +584,7 @@ class UniquePtrMethodsMatcher(gdb.xmethod.XMethodMatcher):
                                             matcher_name_prefix + 'unique_ptr')
         self._method_dict = {
             'get': LibStdCxxXMethod('get', UniquePtrGetWorker),
+            'operator->': LibStdCxxXMethod('operator->', UniquePtrGetWorker),
             'operator*': LibStdCxxXMethod('operator*', UniquePtrDerefWorker),
         }
         self.methods = [self._method_dict[m] for m in self._method_dict]
index 5d59b551f52bce619c69fc2f1265dce25cd4e646..c449f525a419bca254daa3d77a11697f81b7a4cb 100644 (file)
 
 #include <memory>
 
+struct x_struct
+{
+  int y;
+};
+
 int
 main ()
 {
   int *i = new int;
   *i = 10;
-
   std::unique_ptr<int> p(i);
+
+  x_struct *x = new x_struct;
+  x->y = 23;
+  std::unique_ptr<x_struct> q(x);
+
 // { dg-final { note-test *p 10 } }
 // { dg-final { regexp-test p.get() 0x.* } }
 
 // { dg-final { whatis-test *p int } }
 // { dg-final { whatis-test p.get() "int \*" } }
 
+// { dg-final { note-test *q {\{y = 23\}} } }
+// { dg-final { regexp-test q.get() 0x.* } }
+// { dg-final { note-test q->y 23 } }
+
+// { dg-final { whatis-test *q x_struct } }
+// { dg-final { whatis-test q.get() "x_struct \*" } }
+// { dg-final { whatis-test q->y int } }
+
   return 0;  // Mark SPOT
 }