Call overloaded operators to perform operations on gdb.Value objects.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-value-cc.cc
index ace957a14660ab06047f81f2f0310e4de7371f65..7ea4f5d7865a40f1d035f08f09162f9626b88083 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 class A {
+ public:
+  int operator+ (const int a1);
+
  public:
   int a;
 };
 
+int
+A::operator+ (const int a1)
+{
+  return a + a1;
+}
+
 union U {
   int a;
   char c;
@@ -88,5 +97,7 @@ main ()
 {
   A obj;
 
+  obj.a = 5;
+
   return func (obj);
 }
This page took 0.02699 seconds and 4 git commands to generate.