# HG changeset patch # User John W. Eaton # Date 1552631887 0 # Node ID c33ac5ca0a7a624b4bdc2a3883e1889091c9b2d3 # Parent 0a13d8d197901163da03a92ad75d641ac304c559 avoid some overloaded virtual warnings (bug #55741) * ov-base-diag.h, ov-base-sparse.h, ov-complex.h, ov-float.h, ov-flt-complex.h, ov-lazy-idx.h, ov-perm.h, ov-scalar.h, ov-str-mat.h: Avoid overloaded virtual method warnings for classes derived from octave_function that partially overload the two virtual diag methods by adding using declarations. diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-base-diag.h --- a/libinterp/octave-value/ov-base-diag.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-base-diag.h Fri Mar 15 06:38:07 2019 +0000 @@ -109,6 +109,11 @@ MatrixType matrix_type (const MatrixType&) const { return matrix_type (); } + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::diag; + octave_value diag (octave_idx_type k = 0) const; octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-base-sparse.h --- a/libinterp/octave-value/ov-base-sparse.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-base-sparse.h Fri Mar 15 06:38:07 2019 +0000 @@ -127,6 +127,11 @@ octave_value all (int dim = 0) const { return matrix.all (dim); } octave_value any (int dim = 0) const { return matrix.any (dim); } + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::diag; + octave_value diag (octave_idx_type k = 0) const { return octave_value (matrix.diag (k)); } diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-complex.h --- a/libinterp/octave-value/ov-complex.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-complex.h Fri Mar 15 06:38:07 2019 +0000 @@ -159,6 +159,11 @@ octave_value as_double (void) const; octave_value as_single (void) const; + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_scalar::diag; + octave_value diag (octave_idx_type m, octave_idx_type n) const; void increment (void) { scalar += 1.0; } diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-float.h --- a/libinterp/octave-value/ov-float.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-float.h Fri Mar 15 06:38:07 2019 +0000 @@ -229,6 +229,11 @@ octave_value as_uint32 (void) const; octave_value as_uint64 (void) const; + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_scalar::diag; + octave_value diag (octave_idx_type m, octave_idx_type n) const; octave_value convert_to_str_internal (bool pad, bool force, char type) const; diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-flt-complex.h --- a/libinterp/octave-value/ov-flt-complex.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-flt-complex.h Fri Mar 15 06:38:07 2019 +0000 @@ -155,6 +155,11 @@ octave_value as_double (void) const; octave_value as_single (void) const; + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_scalar::diag; + octave_value diag (octave_idx_type m, octave_idx_type n) const; void increment (void) { scalar += 1.0; } diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-lazy-idx.h --- a/libinterp/octave-value/ov-lazy-idx.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-lazy-idx.h Fri Mar 15 06:38:07 2019 +0000 @@ -182,6 +182,11 @@ FORWARD_VALUE_QUERY1 (SparseMatrix, sparse_matrix_value) FORWARD_VALUE_QUERY1 (SparseComplexMatrix, sparse_complex_matrix_value) + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::diag; + octave_value diag (octave_idx_type k = 0) const { return make_value ().diag (k); diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-perm.h --- a/libinterp/octave-value/ov-perm.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-perm.h Fri Mar 15 06:38:07 2019 +0000 @@ -91,6 +91,11 @@ MatrixType matrix_type (const MatrixType&) const { return matrix_type (); } + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_value::diag; + octave_value diag (octave_idx_type k = 0) const { return to_dense () .diag (k); } diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-scalar.h --- a/libinterp/octave-value/ov-scalar.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-scalar.h Fri Mar 15 06:38:07 2019 +0000 @@ -232,6 +232,11 @@ octave_value as_uint32 (void) const; octave_value as_uint64 (void) const; + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_base_scalar::diag; + octave_value diag (octave_idx_type m, octave_idx_type n) const; octave_value convert_to_str_internal (bool pad, bool force, char type) const; diff -r 0a13d8d19790 -r c33ac5ca0a7a libinterp/octave-value/ov-str-mat.h --- a/libinterp/octave-value/ov-str-mat.h Fri Mar 15 06:36:56 2019 +0000 +++ b/libinterp/octave-value/ov-str-mat.h Fri Mar 15 06:38:07 2019 +0000 @@ -106,6 +106,11 @@ octave_value resize (const dim_vector& dv, bool fill = false) const; + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_char_matrix::diag; + octave_value diag (octave_idx_type k = 0) const { return octave_value (matrix.diag (k)); } @@ -237,6 +242,11 @@ return octave_value (retval, '\''); } + // We don't need to override both forms of the diag method. The using + // declaration will avoid warnings about partially-overloaded virtual + // functions. + using octave_char_matrix_str::diag; + octave_value diag (octave_idx_type k = 0) const { return octave_value (matrix.diag (k), '\''); }