# HG changeset patch # User John W. Eaton # Date 1552629155 0 # Node ID 9dd1d89738777cbb8400351aef03021c4b9f881e # Parent 9cd4b045fe3d66a2c4e2f737d42ae0b66d987325 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. diff -r 9cd4b045fe3d -r 9dd1d8973877 libinterp/octave-value/ov-builtin.h --- 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 ()); diff -r 9cd4b045fe3d -r 9dd1d8973877 libinterp/octave-value/ov-classdef.h --- 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); diff -r 9cd4b045fe3d -r 9dd1d8973877 libinterp/octave-value/ov-mex-fcn.h --- 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 ()); diff -r 9cd4b045fe3d -r 9dd1d8973877 libinterp/octave-value/ov-usr-fcn.h --- 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 ());