Mercurial > octave
changeset 26916:9cd4b045fe3d
avoid some overloaded virtual warnings (bug #55741)
* ov-base-diag.h, ov-base-mat.h, ov-base-scalar.h, ov-base-sparse.h,
ov-base.h, ov-class.h, ov-classdef.h, ov-cs-list.h, ov-fcn-handle.h,
ov-java.h, ov-lazy-idx.h, ov-perm.h, ov-range.h: Avoid overloaded
virtual method warnings for classes derived from octave_base_value
that partially overload the three virtual subsref methods by adding
using declarations.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 15 Mar 2019 05:45:27 +0000 |
parents | 5ef01ab5c9e5 |
children | 9dd1d8973877 |
files | libinterp/octave-value/ov-base-diag.h libinterp/octave-value/ov-base-mat.h libinterp/octave-value/ov-base-scalar.h libinterp/octave-value/ov-base-sparse.h libinterp/octave-value/ov-base.h libinterp/octave-value/ov-class.h libinterp/octave-value/ov-classdef.h libinterp/octave-value/ov-cs-list.h libinterp/octave-value/ov-fcn-handle.h libinterp/octave-value/ov-java.h libinterp/octave-value/ov-lazy-idx.h libinterp/octave-value/ov-perm.h libinterp/octave-value/ov-range.h libinterp/octave-value/ov.h |
diffstat | 14 files changed, 65 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-base-diag.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-base-diag.h Fri Mar 15 05:45:27 2019 +0000 @@ -64,6 +64,11 @@ octave_value full_value (void) const { return to_dense (); } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov-base-mat.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-base-mat.h Fri Mar 15 05:45:27 2019 +0000 @@ -75,6 +75,11 @@ void maybe_economize (void) { matrix.maybe_economize (); } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov-base-scalar.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-base-scalar.h Fri Mar 15 05:45:27 2019 +0000 @@ -61,6 +61,11 @@ octave_value full_value (void) const { return scalar; } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov-base-sparse.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-base-sparse.h Fri Mar 15 05:45:27 2019 +0000 @@ -84,6 +84,11 @@ octave_value full_value (void) const { return matrix.matrix_value (); } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov-base.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-base.h Fri Mar 15 05:45:27 2019 +0000 @@ -280,6 +280,8 @@ virtual octave_idx_type numel (const octave_value_list&); + // FIXME: Do we really need all three of these versions of subsref? + virtual octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov-class.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-class.h Fri Mar 15 05:45:27 2019 +0000 @@ -87,6 +87,11 @@ octave_idx_type numel (const octave_value_list&); + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) {
--- a/libinterp/octave-value/ov-classdef.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-classdef.h Fri Mar 15 05:45:27 2019 +0000 @@ -177,6 +177,11 @@ octave_function * function_value (bool = false) { return this; } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_function::subsref; + octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx,
--- a/libinterp/octave-value/ov-cs-list.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-cs-list.h Fri Mar 15 05:45:27 2019 +0000 @@ -71,6 +71,11 @@ octave_value_list list_value (void) const { return lst; } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov-fcn-handle.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-fcn-handle.h Fri Mar 15 05:45:27 2019 +0000 @@ -85,6 +85,11 @@ octave_base_value * empty_clone (void) const { return new octave_fcn_handle (); } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) {
--- a/libinterp/octave-value/ov-java.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-java.h Fri Mar 15 05:45:27 2019 +0000 @@ -91,6 +91,11 @@ bool load_hdf5 (octave_hdf5_id loc_id, const char *name); + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int nargout);
--- a/libinterp/octave-value/ov-lazy-idx.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-lazy-idx.h Fri Mar 15 05:45:27 2019 +0000 @@ -75,6 +75,11 @@ bool isfloat (void) const { return true; } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) { return make_value ().subsref (type, idx); }
--- a/libinterp/octave-value/ov-perm.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-perm.h Fri Mar 15 05:45:27 2019 +0000 @@ -56,6 +56,11 @@ octave_value full_value (void) const { return to_dense (); } + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov-range.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov-range.h Fri Mar 15 05:45:27 2019 +0000 @@ -93,6 +93,11 @@ octave_base_value * try_narrowing_conversion (void); + // We don't need to override all three forms of subsref. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::subsref; + octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx);
--- a/libinterp/octave-value/ov.h Thu Mar 14 17:52:30 2019 -0700 +++ b/libinterp/octave-value/ov.h Fri Mar 15 05:45:27 2019 +0000 @@ -409,6 +409,9 @@ octave_idx_type numel (const octave_value_list& idx) { return rep->numel (idx); } + // FIXME: Do we really need all these different versions of subsref + // and related functions? + octave_value single_subsref (const std::string& type, const octave_value_list& idx);