constify error_no_arg
[deliverable/binutils-gdb.git] / gdb / valarith.c
index 894a87ac04864443980fc0b61ed956bcf6424ec0..4da41cbe517888a69cd328e3a07538b439da8c8a 100644 (file)
@@ -1,6 +1,6 @@
 /* Perform arithmetic and other operations on values, for GDB.
 
-   Copyright (C) 1986-2013 Free Software Foundation, Inc.
+   Copyright (C) 1986-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,7 +24,7 @@
 #include "expression.h"
 #include "target.h"
 #include "language.h"
-#include "gdb_string.h"
+#include <string.h>
 #include "doublest.h"
 #include "dfp.h"
 #include <math.h>
@@ -294,7 +294,7 @@ value_user_defined_cpp_op (struct value **args, int nargs, char *operator,
   struct value *valp = NULL;
 
   find_overload_match (args, nargs, operator, BOTH /* could be method */,
-                       0 /* strict match */, &args[0], /* objp */
+                       &args[0] /* objp */,
                        NULL /* pass NULL symbol since symbol is unknown */,
                        &valp, &symp, static_memfuncp, 0);
 
@@ -489,8 +489,16 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op,
            = TYPE_TARGET_TYPE (check_typedef (value_type (argvec[0])));
          return value_zero (return_type, VALUE_LVAL (arg1));
        }
-      return call_function_by_hand (argvec[0], 2 - static_memfuncp,
-                                   argvec + 1);
+
+      if (TYPE_CODE (value_type (argvec[0])) == TYPE_CODE_XMETHOD)
+       {
+         /* Static xmethods are not supported yet.  */
+         gdb_assert (static_memfuncp == 0);
+         return call_xmethod (argvec[0], 2, argvec + 1);
+       }
+      else
+       return call_function_by_hand (argvec[0], 2 - static_memfuncp,
+                                     argvec + 1);
     }
   throw_error (NOT_FOUND_ERROR,
                _("member function %s not found"), tstr);
@@ -510,7 +518,7 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
 {
   struct gdbarch *gdbarch = get_type_arch (value_type (arg1));
   struct value **argvec;
-  char *ptr, *mangle_ptr;
+  char *ptr;
   char tstr[13], mangle_tstr[13];
   int static_memfuncp, nargs;
 
@@ -532,7 +540,6 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
   strcpy (tstr, "operator__");
   ptr = tstr + 8;
   strcpy (mangle_tstr, "__");
-  mangle_ptr = mangle_tstr + 2;
   switch (op)
     {
     case UNOP_PREINCREMENT:
@@ -594,7 +601,14 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
            = TYPE_TARGET_TYPE (check_typedef (value_type (argvec[0])));
          return value_zero (return_type, VALUE_LVAL (arg1));
        }
-      return call_function_by_hand (argvec[0], nargs, argvec + 1);
+      if (TYPE_CODE (value_type (argvec[0])) == TYPE_CODE_XMETHOD)
+       {
+         /* Static xmethods are not supported yet.  */
+         gdb_assert (static_memfuncp == 0);
+         return call_xmethod (argvec[0], 1, argvec + 1);
+       }
+      else
+       return call_function_by_hand (argvec[0], nargs, argvec + 1);
     }
   throw_error (NOT_FOUND_ERROR,
                _("member function %s not found"), tstr);
This page took 0.024538 seconds and 4 git commands to generate.