changeset 26917:9dd1d8973877

avoid some overloaded virtual warnings (bug #55741) * ov-builtin.h, ov-classdef.h, ov-mex-fcn.h, ov-usr-fcn.h: Avoid overloaded virtual method warnings for classes derived from octave_function that partially overload the two virtual call methods by adding using declarations.
author John W. Eaton <jwe@octave.org>
date Fri, 15 Mar 2019 05:52:35 +0000
parents 9cd4b045fe3d
children 0a13d8d19790
files libinterp/octave-value/ov-builtin.h libinterp/octave-value/ov-classdef.h libinterp/octave-value/ov-mex-fcn.h libinterp/octave-value/ov-usr-fcn.h
diffstat 4 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-builtin.h	Fri Mar 15 05:45:27 2019 +0000
+++ b/libinterp/octave-value/ov-builtin.h	Fri Mar 15 05:52:35 2019 +0000
@@ -93,6 +93,11 @@
 
   bool is_builtin_function (void) const { return true; }
 
+  // We don't need to override both forms of the call method.  The using
+  // declaration will avoid warnings about partially-overloaded virtual
+  // functions.
+  using octave_function::call;
+
   octave_value_list
   call (octave::tree_evaluator& tw, int nargout = 0,
         const octave_value_list& args = octave_value_list ());
--- a/libinterp/octave-value/ov-classdef.h	Fri Mar 15 05:45:27 2019 +0000
+++ b/libinterp/octave-value/ov-classdef.h	Fri Mar 15 05:52:35 2019 +0000
@@ -190,6 +190,11 @@
     return object.meta_subsref (type, idx, nargout);
   }
 
+  // We don't need to override both forms of the call method.  The using
+  // declaration will avoid warnings about partially-overloaded virtual
+  // functions.
+  using octave_function::call;
+
   octave_value_list call (octave::tree_evaluator&, int nargout,
                           const octave_value_list& args)
   {
@@ -231,6 +236,11 @@
 
   octave_function * function_value (bool = false) { return this; }
 
+  // We don't need to override both forms of the call method.  The using
+  // declaration will avoid warnings about partially-overloaded virtual
+  // functions.
+  using octave_function::call;
+
   octave_value_list
   call (octave::tree_evaluator& tw, int nargout, const octave_value_list& idx);
 
--- a/libinterp/octave-value/ov-mex-fcn.h	Fri Mar 15 05:45:27 2019 +0000
+++ b/libinterp/octave-value/ov-mex-fcn.h	Fri Mar 15 05:52:35 2019 +0000
@@ -85,6 +85,11 @@
 
   bool is_mex_function (void) const { return true; }
 
+  // We don't need to override both forms of the call method.  The using
+  // declaration will avoid warnings about partially-overloaded virtual
+  // functions.
+  using octave_function::call;
+
   octave_value_list
   call (octave::tree_evaluator& tw, int nargout = 0,
         const octave_value_list& args = octave_value_list ());
--- a/libinterp/octave-value/ov-usr-fcn.h	Fri Mar 15 05:45:27 2019 +0000
+++ b/libinterp/octave-value/ov-usr-fcn.h	Fri Mar 15 05:52:35 2019 +0000
@@ -180,6 +180,11 @@
 
   bool is_user_script (void) const { return true; }
 
+  // We don't need to override both forms of the call method.  The using
+  // declaration will avoid warnings about partially-overloaded virtual
+  // functions.
+  using octave_user_code::call;
+
   octave_value_list
   call (octave::tree_evaluator& tw, int nargout = 0,
         const octave_value_list& args = octave_value_list ());