-Wdeprecated-copy

Issue #197 resolved
Daniel Baker created an issue

With the following test program, a deprecated copy constructor warning is thrown. Is this working as intended?

Here's an example program and the warning emitted.

#include "blaze/blaze/Math.h"
#include "blaze/blaze/Util.h"
#include <iostream>
#include <fstream>
int main() {
    blaze::DynamicMatrix<double> mat{{2,3,4}, {3,4,5}};
    blaze::DynamicMatrix<double> mat2;
    blaze::Archive<std::ifstream> *archive = new blaze::Archive<std::ifstream>( "fake.blaze" );
    {
        blaze::Archive<std::ofstream> archive2( "fake.out.blaze" );
        archive->operator>>(mat);
        archive2 << mat;
        ::std::cerr << mat << '\n' << "Now writing to archive2 a seocnd time\n";
        mat2 = mat * 5.; /* line 14 */
        archive2 << mat2;
    }
    ::std::cerr << mat2 << '\n';
    delete archive;
    archive = new blaze::Archive<std::ifstream>( "fake.out.blaze" );
    ::std::cerr << "About to do the 1st time" << mat2 << '\n';
    archive->operator>>(mat2);
    ::std::cerr << "About to do the 2nd time" << mat2 << '\n';
    archive->operator>>(mat2);
    ::std::cerr << "About to do the extra time" << mat2 << '\n';
    archive->operator>>(mat2);
    delete archive;
}

Warning:

In file included from blaze/blaze/math/DenseMatrix.h:77,
                 from blaze/blaze/math/CustomMatrix.h:45,
                 from stochasticSVM/blaze/blaze/Math.h:51,
                 from src/testmat.cpp:1:
blaze/blaze/math/expressions/DMatScalarMultExpr.h: In instantiation of blaze::DMatScalarMultExpr< <template-parameter-1-1>, <template-parameter-1-2>, <anonymous> >::DMatScalarMultExpr(const MT&, ST) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>; ST = double; bool SO = false]:
blaze/blaze/math/expressions/DMatScalarMultExpr.h:1067:11:   required from decltype(auto) blaze::operator*(const blaze::DenseMatrix<MT, SO>&, ST) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>; bool SO = false; ST = double; <template-parameter-1-4> = void]
blaze/blaze/math/views/Submatrix.h:1088:69:   required from decltype(auto) blaze::submatrix(const blaze::MatScalarMultExpr<MT>&, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)1; long unsigned int ...CSAs = {}; MT = blaze::DenseMatrix<blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>, false>; RSAs = {long unsigned int, long unsigned int, long unsigned int, long unsigned int}]
blaze/blaze/math/smp/openmp/DenseMatrix.h:144:47:   required from void blaze::openmpAssign(blaze::DenseMatrix<MT, SO>&, const blaze::DenseMatrix<MT, SO>&, OP) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; OP = blaze::Assign]
blaze/blaze/math/smp/openmp/DenseMatrix.h:310:22:   required from blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> blaze::smpAssign(blaze::Matrix<MT1, SO1>&, const blaze::Matrix<MT2, SO2>&) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> = void]
blaze/blaze/math/dense/DynamicMatrix.h:1335:16:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::operator=(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; Type = double; bool SO = false]
src/testmat.cpp:14:22:   required from here
blaze/blaze/math/expressions/DMatScalarMultExpr.h:448:25: warning: implicitly-declared constexpr blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>::Submatrix(const blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>&) is deprecated [-Wdeprecated-copy]
       , scalar_( scalar )  // Right-hand side scalar of the multiplication expression
                         ^
In file included from blaze/blaze/math/views/Submatrix.h:90,
                 from blaze/blaze/math/adaptors/diagonalmatrix/Dense.h:74,
                 from blaze/blaze/math/adaptors/DiagonalMatrix.h:45,
                 from blaze/blaze/math/SparseMatrix.h:43,
                 from blaze/blaze/math/CompressedMatrix.h:49,
                 from stochasticSVM/blaze/blaze/Math.h:48,
                 from src/testmat.cpp:1:
blaze/blaze/math/views/submatrix/Dense.h:7458:4: note: because blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true> has user-provided blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>& blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>::operator=(const blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>&) [with MT = const blaze::DynamicMatrix<double>; long unsigned int ...CSAs = {}]
    Submatrix<MT,aligned,false,true,CSAs...>::operator=( const Submatrix& rhs )
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from blaze/blaze/math/DenseMatrix.h:77,
                 from blaze/blaze/math/CustomMatrix.h:45,
                 from stochasticSVM/blaze/blaze/Math.h:51,
                 from src/testmat.cpp:1:
blaze/blaze/math/expressions/DMatScalarMultExpr.h: In instantiation of blaze::DMatScalarMultExpr< <template-parameter-1-1>, <template-parameter-1-2>, <anonymous> >::DMatScalarMultExpr(const MT&, ST) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>; ST = double; bool SO = false]:
blaze/blaze/math/expressions/DMatScalarMultExpr.h:1067:11:   required from decltype(auto) blaze::operator*(const blaze::DenseMatrix<MT, SO>&, ST) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>; bool SO = false; ST = double; <template-parameter-1-4> = void]
blaze/blaze/math/views/Submatrix.h:1088:69:   required from decltype(auto) blaze::submatrix(const blaze::MatScalarMultExpr<MT>&, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)0; long unsigned int ...CSAs = {}; MT = blaze::DenseMatrix<blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>, false>; RSAs = {long unsigned int, long unsigned int, long unsigned int, long unsigned int}]
blaze/blaze/math/smp/openmp/DenseMatrix.h:149:49:   required from void blaze::openmpAssign(blaze::DenseMatrix<MT, SO>&, const blaze::DenseMatrix<MT, SO>&, OP) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; OP = blaze::Assign]
blaze/blaze/math/smp/openmp/DenseMatrix.h:310:22:   required from blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> blaze::smpAssign(blaze::Matrix<MT1, SO1>&, const blaze::Matrix<MT2, SO2>&) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> = void]
blaze/blaze/math/dense/DynamicMatrix.h:1335:16:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::operator=(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; Type = double; bool SO = false]
src/testmat.cpp:14:22:   required from here
blaze/blaze/math/expressions/DMatScalarMultExpr.h:448:25: warning: implicitly-declared constexpr blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>::Submatrix(const blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>&) is deprecated [-Wdeprecated-copy]
       , scalar_( scalar )  // Right-hand side scalar of the multiplication expression
                         ^
In file included from blaze/blaze/math/views/Submatrix.h:90,
                 from blaze/blaze/math/adaptors/diagonalmatrix/Dense.h:74,
                 from blaze/blaze/math/adaptors/DiagonalMatrix.h:45,
                 from blaze/blaze/math/SparseMatrix.h:43,
                 from blaze/blaze/math/CompressedMatrix.h:49,
                 from stochasticSVM/blaze/blaze/Math.h:48,
                 from src/testmat.cpp:1:
blaze/blaze/math/views/submatrix/Dense.h:1361:4: note: because blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true> has user-provided blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>& blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>::operator=(const blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>&) [with MT = const blaze::DynamicMatrix<double>; long unsigned int ...CSAs = {}]
    Submatrix<MT,unaligned,false,true,CSAs...>::operator=( const Submatrix& rhs )
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from blaze/blaze/math/DenseMatrix.h:88,
                 from blaze/blaze/math/CustomMatrix.h:45,
                 from stochasticSVM/blaze/blaze/Math.h:51,
                 from src/testmat.cpp:1:
blaze/blaze/math/expressions/DMatTransExpr.h: In instantiation of blaze::DMatTransExpr< <template-parameter-1-1>, <anonymous> >::DMatTransExpr(const MT&) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>; bool SO = true]:
blaze/blaze/math/expressions/DMatTransExpr.h:777:11:   required from decltype(auto) blaze::trans(const blaze::DenseMatrix<MT, SO>&) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>; bool SO = false]
blaze/blaze/math/views/Submatrix.h:1305:16:   required from decltype(auto) blaze::submatrix(const blaze::MatTransExpr<MT>&, std::size_t, std::size_t, std::size_t, std::size_t, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)1; MT = blaze::DenseMatrix<blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>, true>; RSAs = {}; std::size_t = long unsigned int]
blaze/blaze/math/smp/openmp/DenseMatrix.h:144:47:   required from void blaze::openmpAssign(blaze::DenseMatrix<MT, SO>&, const blaze::DenseMatrix<MT, SO>&, OP) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>; bool SO2 = true; OP = blaze::Assign]
blaze/blaze/math/smp/openmp/DenseMatrix.h:310:22:   required from blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> blaze::smpAssign(blaze::Matrix<MT1, SO1>&, const blaze::Matrix<MT2, SO2>&) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>; bool SO2 = true; blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> = void]
blaze/blaze/math/dense/DynamicMatrix.h:795:13:   required from blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::DynamicMatrix(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>; bool SO2 = true; Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1887:21:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::transpose() [with Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1322:7:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::operator=(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; Type = double; bool SO = false]
src/testmat.cpp:14:22:   required from here
blaze/blaze/math/expressions/DMatTransExpr.h:179:17: warning: implicitly-declared constexpr blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>::Submatrix(const blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>&) is deprecated [-Wdeprecated-copy]
       : dm_( dm )  // Dense matrix of the transposition expression
                 ^
In file included from blaze/blaze/math/views/Submatrix.h:90,
                 from blaze/blaze/math/adaptors/diagonalmatrix/Dense.h:74,
                 from blaze/blaze/math/adaptors/DiagonalMatrix.h:45,
                 from blaze/blaze/math/SparseMatrix.h:43,
                 from blaze/blaze/math/CompressedMatrix.h:49,
                 from stochasticSVM/blaze/blaze/Math.h:48,
                 from src/testmat.cpp:1:
blaze/blaze/math/views/submatrix/Dense.h:7458:4: note: because blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true> has user-provided blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>& blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>::operator=(const blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>&) [with MT = const blaze::DynamicMatrix<double>; long unsigned int ...CSAs = {}]
    Submatrix<MT,aligned,false,true,CSAs...>::operator=( const Submatrix& rhs )
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from blaze/blaze/math/DenseMatrix.h:88,
                 from blaze/blaze/math/CustomMatrix.h:45,
                 from stochasticSVM/blaze/blaze/Math.h:51,
                 from src/testmat.cpp:1:
blaze/blaze/math/expressions/DMatTransExpr.h: In instantiation of blaze::DMatTransExpr< <template-parameter-1-1>, <anonymous> >::DMatTransExpr(const MT&) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>; bool SO = true]:
blaze/blaze/math/expressions/DMatTransExpr.h:777:11:   required from decltype(auto) blaze::trans(const blaze::DenseMatrix<MT, SO>&) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>; bool SO = false]
blaze/blaze/math/views/Submatrix.h:1305:16:   required from decltype(auto) blaze::submatrix(const blaze::MatTransExpr<MT>&, std::size_t, std::size_t, std::size_t, std::size_t, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)0; MT = blaze::DenseMatrix<blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>, true>; RSAs = {}; std::size_t = long unsigned int]
blaze/blaze/math/smp/openmp/DenseMatrix.h:149:49:   required from void blaze::openmpAssign(blaze::DenseMatrix<MT, SO>&, const blaze::DenseMatrix<MT, SO>&, OP) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>; bool SO2 = true; OP = blaze::Assign]
blaze/blaze/math/smp/openmp/DenseMatrix.h:310:22:   required from blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> blaze::smpAssign(blaze::Matrix<MT1, SO1>&, const blaze::Matrix<MT2, SO2>&) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>; bool SO2 = true; blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> = void]
blaze/blaze/math/dense/DynamicMatrix.h:795:13:   required from blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::DynamicMatrix(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatTransExpr<blaze::DynamicMatrix<double>, true>; bool SO2 = true; Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1887:21:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::transpose() [with Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1322:7:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::operator=(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; Type = double; bool SO = false]
src/testmat.cpp:14:22:   required from here
blaze/blaze/math/expressions/DMatTransExpr.h:179:17: warning: implicitly-declared constexpr blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>::Submatrix(const blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>&) is deprecated [-Wdeprecated-copy]
       : dm_( dm )  // Dense matrix of the transposition expression
                 ^
In file included from blaze/blaze/math/views/Submatrix.h:90,
                 from blaze/blaze/math/adaptors/diagonalmatrix/Dense.h:74,
                 from blaze/blaze/math/adaptors/DiagonalMatrix.h:45,
                 from blaze/blaze/math/SparseMatrix.h:43,
                 from blaze/blaze/math/CompressedMatrix.h:49,
                 from stochasticSVM/blaze/blaze/Math.h:48,
                 from src/testmat.cpp:1:
blaze/blaze/math/views/submatrix/Dense.h:1361:4: note: because blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true> has user-provided blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>& blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>::operator=(const blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>&) [with MT = const blaze::DynamicMatrix<double>; long unsigned int ...CSAs = {}]
    Submatrix<MT,unaligned,false,true,CSAs...>::operator=( const Submatrix& rhs )
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from blaze/blaze/math/DenseMatrix.h:74,
                 from blaze/blaze/math/CustomMatrix.h:45,
                 from stochasticSVM/blaze/blaze/Math.h:51,
                 from src/testmat.cpp:1:
blaze/blaze/math/expressions/DMatMapExpr.h: In instantiation of blaze::DMatMapExpr< <template-parameter-1-1>, <template-parameter-1-2>, <anonymous> >::DMatMapExpr(const MT&, OP) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>; OP = blaze::Conj; bool SO = false]:
blaze/blaze/math/expressions/DMatMapExpr.h:1127:11:   required from decltype(auto) blaze::map(const blaze::DenseMatrix<MT, SO>&, OP) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>; bool SO = false; OP = blaze::Conj]
blaze/blaze/math/views/Submatrix.h:1140:14:   required from decltype(auto) blaze::submatrix(const blaze::MatMapExpr<MT>&, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)1; long unsigned int ...CSAs = {}; MT = blaze::DenseMatrix<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, false>; RSAs = {long unsigned int, long unsigned int, long unsigned int, long unsigned int}
blaze/blaze/math/views/Submatrix.h:1305:31:   required from decltype(auto) blaze::submatrix(const blaze::MatTransExpr<MT>&, std::size_t, std::size_t, std::size_t, std::size_t, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)1; MT = blaze::DenseMatrix<blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>, true>; RSAs = {}; std::size_t = long unsigned int]
blaze/blaze/math/smp/openmp/DenseMatrix.h:144:47:   required from void blaze::openmpAssign(blaze::DenseMatrix<MT, SO>&, const blaze::DenseMatrix<MT, SO>&, OP) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>; bool SO2 = true; OP = blaze::Assign]
blaze/blaze/math/smp/openmp/DenseMatrix.h:310:22:   required from blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> blaze::smpAssign(blaze::Matrix<MT1, SO1>&, const blaze::Matrix<MT2, SO2>&) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>; bool SO2 = true; blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> = void]
blaze/blaze/math/dense/DynamicMatrix.h:795:13:   required from blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::DynamicMatrix(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>; bool SO2 = true; Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1929:21:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::ctranspose() [with Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1325:7:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::operator=(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; Type = double; bool SO = false]
src/testmat.cpp:14:22:   required from here
blaze/blaze/math/expressions/DMatMapExpr.h:460:17: warning: implicitly-declared constexpr blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>::Submatrix(const blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true>&) is deprecated [-Wdeprecated-copy]
       , op_( op )  // The custom unary operation
                 ^
In file included from blaze/blaze/math/views/Submatrix.h:90,
                 from blaze/blaze/math/adaptors/diagonalmatrix/Dense.h:74,
                 from blaze/blaze/math/adaptors/DiagonalMatrix.h:45,
                 from blaze/blaze/math/SparseMatrix.h:43,
                 from blaze/blaze/math/CompressedMatrix.h:49,
                 from stochasticSVM/blaze/blaze/Math.h:48,
                 from src/testmat.cpp:1:
blaze/blaze/math/views/submatrix/Dense.h:7458:4: note: because blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)1, false, true> has user-provided blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>& blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>::operator=(const blaze::Submatrix<MT, (blaze::AlignmentFlag)1, false, true, CSAs ...>&) [with MT = const blaze::DynamicMatrix<double>; long unsigned int ...CSAs = {}]
    Submatrix<MT,aligned,false,true,CSAs...>::operator=( const Submatrix& rhs )
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from blaze/blaze/math/DenseMatrix.h:74,
                 from blaze/blaze/math/CustomMatrix.h:45,
                 from stochasticSVM/blaze/blaze/Math.h:51,
                 from src/testmat.cpp:1:
blaze/blaze/math/expressions/DMatMapExpr.h: In instantiation of blaze::DMatMapExpr< <template-parameter-1-1>, <template-parameter-1-2>, <anonymous> >::DMatMapExpr(const MT&, OP) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>; OP = blaze::Conj; bool SO = false]:
blaze/blaze/math/expressions/DMatMapExpr.h:1127:11:   required from decltype(auto) blaze::map(const blaze::DenseMatrix<MT, SO>&, OP) [with MT = blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>; bool SO = false; OP = blaze::Conj]
blaze/blaze/math/views/Submatrix.h:1140:14:   required from decltype(auto) blaze::submatrix(const blaze::MatMapExpr<MT>&, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)0; long unsigned int ...CSAs = {}; MT = blaze::DenseMatrix<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, false>; RSAs = {long unsigned int, long unsigned int, long unsigned int, long unsigned int}
blaze/blaze/math/views/Submatrix.h:1305:31:   required from decltype(auto) blaze::submatrix(const blaze::MatTransExpr<MT>&, std::size_t, std::size_t, std::size_t, std::size_t, RSAs ...) [with blaze::AlignmentFlag AF = (blaze::AlignmentFlag)0; MT = blaze::DenseMatrix<blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>, true>; RSAs = {}; std::size_t = long unsigned int]
blaze/blaze/math/smp/openmp/DenseMatrix.h:149:49:   required from void blaze::openmpAssign(blaze::DenseMatrix<MT, SO>&, const blaze::DenseMatrix<MT, SO>&, OP) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>; bool SO2 = true; OP = blaze::Assign]
blaze/blaze/math/smp/openmp/DenseMatrix.h:310:22:   required from blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> blaze::smpAssign(blaze::Matrix<MT1, SO1>&, const blaze::Matrix<MT2, SO2>&) [with MT1 = blaze::DynamicMatrix<double>; bool SO1 = false; MT2 = blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>; bool SO2 = true; blaze::EnableIf_t<((IsDenseMatrix_v<MT1> && IsSMPAssignable_v<MT1>) && IsSMPAssignable_v<MT2>)> = void]
blaze/blaze/math/dense/DynamicMatrix.h:795:13:   required from blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::DynamicMatrix(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatTransExpr<blaze::DMatMapExpr<blaze::DynamicMatrix<double>, blaze::Conj, false>, true>; bool SO2 = true; Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1929:21:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::ctranspose() [with Type = double; bool SO = false]
blaze/blaze/math/dense/DynamicMatrix.h:1325:7:   required from blaze::DynamicMatrix<T1, SO>& blaze::DynamicMatrix< <template-parameter-1-1>, <anonymous> >::operator=(const blaze::Matrix<MT, SO>&) [with MT = blaze::DMatScalarMultExpr<blaze::DynamicMatrix<double>, double, false>; bool SO2 = false; Type = double; bool SO = false]
src/testmat.cpp:14:22:   required from here
blaze/blaze/math/expressions/DMatMapExpr.h:460:17: warning: implicitly-declared constexpr blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>::Submatrix(const blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true>&) is deprecated [-Wdeprecated-copy]
       , op_( op )  // The custom unary operation
                 ^
In file included from blaze/blaze/math/views/Submatrix.h:90,
                 from blaze/blaze/math/adaptors/diagonalmatrix/Dense.h:74,
                 from blaze/blaze/math/adaptors/DiagonalMatrix.h:45,
                 from blaze/blaze/math/SparseMatrix.h:43,
                 from blaze/blaze/math/CompressedMatrix.h:49,
                 from stochasticSVM/blaze/blaze/Math.h:48,
                 from src/testmat.cpp:1:
blaze/blaze/math/views/submatrix/Dense.h:1361:4: note: because blaze::Submatrix<const blaze::DynamicMatrix<double>, (blaze::AlignmentFlag)0, false, true> has user-provided blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>& blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>::operator=(const blaze::Submatrix<MT, (blaze::AlignmentFlag)0, false, true, CSAs ...>&) [with MT = const blaze::DynamicMatrix<double>; long unsigned int ...CSAs = {}]
    Submatrix<MT,unaligned,false,true,CSAs...>::operator=( const Submatrix& rhs )

Comments (7)

  1. Klaus Iglberger

    Hi Daniel!

    Thanks for posting the issue. Unfortunately we cannot reproduce the issue despite using both GCC and Clang with the flags -Wall -Wextra. Could you please tell us which compiler you are using and also post your command line (especially your compiler flags)? Thanks,

    Best regards,

    Klaus!

  2. Daniel Baker reporter

    I'm able to cause the warning as such:

    /rcap/DATA03/project/CSO/dnb/tmp/gcc/gccbuild/bin/g++ -O3 -funroll-loops -pipe -fno-strict-aliasing -march=native -m64 -msse2  -Wl,-rpath=/home/danielb/miniconda3/lib  -DZWRAP_USE_ZSTD=1 -fopenmp -DOMIT_PORT_COUNTS    -std=c++17 -Wall -Wextra -Wno-char-subscripts -Wpointer-arith -Wwrite-strings -Wdisabled-optimization -Wformat=2 -Wcast-align -Wno-unused-function -Wno-unused-parameter -pedantic -Wunused-variable -Wreturn-type -Winvalid-pch  -I. -Iinclude -Iblaze -Izstd/zlibWrapper -Izstd/lib/common -Izstd/lib -IstochasticSVM/frp/include -IstochasticSVM -IstochasticSVM/frp/FFHT -IstochasticSVM/frp -IstochasticSVM/frp/vec/sleef/build/include -IstochasticSVM/frp/fastrange -Lzstd/lib -LstochasticSVM/frp/vec/sleef/build/lib/ -Wl,-rpath=/home/danielb/miniconda3/lib  -DNDEBUG stochasticSVM/frp/FFHT/fht.o src/testmat.cpp  zstd/zlibWrapper/gzclose.o zstd/zlibWrapper/gzlib.o zstd/zlibWrapper/zstd_zlibwrapper.o zstd/zlibWrapper/gzread.o zstd/zlibWrapper/gzwrite.o libzstd.a zlib/libz.a -o testmat -O3 -funroll-loops -pipe -fno-strict-aliasing -march=native -m64 -msse2  -Wl,-rpath=/home/danielb/miniconda3/lib  -DZWRAP_USE_ZSTD=1 -fopenmp -DOMIT_PORT_COUNTS   -lsleef
    

    I'm having trouble reproducing this issue with fewer flags. Removing -fopenmp or removing all of the -I flags eliminates the warning, so -fopenmp seems to be necessary but not sufficient on mine. (The setup for this compilation is an environment using a variety of tools to compile executables, which is why the command is so cluttered.)

  3. Klaus Iglberger

    Hi Daniel!

    Thanks, that helps. The warnings are a result of some old C++98 code. The code works perfectly, but we will update and modernize it to get rid of the warnings. Thanks for pointing out this problem,

    Best regards,

    Klaus!

  4. Klaus Iglberger

    Commit 3a39f5c implements the fix to resolve all compiler warnings caused by implicitly declared copy operations. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.5.

  5. Log in to comment