Home Internal compiler error on a template function specialization
Reply: 0

Internal compiler error on a template function specialization

user9319
1#
user9319 Published in September 19, 2018, 3:17 am

I have a code that worked on Lunix/GCC. However, when compiling on Windows/MSVC 2017, I am facing an internal compiler error:

.hpp:

namespace g2o {
namespace internal {

    template<typename MatrixType>
    inline void axpy(const MatrixType& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
        y.segment<MatrixType::RowsAtCompileTime>(yoff) += A * x.segment<MatrixType::ColsAtCompileTime>(xoff);
    }

    template<int t>
    inline void axpy(const Eigen::Matrix<double, Eigen::Dynamic, t>& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
        y.segment(yoff, A.rows()) += A * x.segment<Eigen::Matrix<double, Eigen::Dynamic, t>::ColsAtCompileTime>(xoff);
    }

    template<> /*******ERROR HERE*******/
    inline void axpy(const Eigen::MatrixXd& A, const Eigen::Map<const Eigen::VectorXd>& x, int xoff, Eigen::Map<Eigen::VectorXd>& y, int yoff) {
        y.segment(yoff, A.rows()) += A * x.segment(xoff, A.cols());
    }   
} // end namespace internal
} // end namespace g2o

I saw solution telling that I should do the following:

template<Eigen::MatrixXd> inline void axpy<Eigen::MatrixXd> ....

However, it did not work.


Error message as it was produced by the compiler:

Error C1001 An internal error has occurred in the compiler.

share|improve this question
  • The error really doesn't say anything more? – usr2564301 Jan 13 at 1:53
  • @usr2564301 yes, it does not – Humam Helfawi Jan 13 at 1:53
  • @KenWhite OK, I edited – Humam Helfawi Jan 13 at 1:57
  • Post a complete program that crashes the compiler, and we can look into it. – Jive Dadson Jan 13 at 4:21
  • MSVC 2017 has been updated a lot recently. It would be best to include the complete version number in the question. – Christian Hackl Jan 13 at 10:03

1 Answer 1

active oldest votes
up vote 1 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.339164 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO