[cfe-users] implicit instantiation of undefined template; difference between g++ and clang++

Mike Vermeulen mevermeulen at gmail.com
Thu Apr 17 07:31:48 PDT 2014


Following is a reduced test case from parsec suite that compiles with g++
and fails to compile with clang++ 3.4:

template<class T> class MATRIX_3X3;

template<class T> class DIAGONAL_MATRIX_3X3;



template<class T>

class SYMMETRIC_MATRIX_3X3

{

 public:

  void Fast_Solve_Eigenproblem(DIAGONAL_MATRIX_3X3<T>& eigenvalues,

                               MATRIX_3X3<T>& eigenvectors) const

  {

    DIAGONAL_MATRIX_3X3<double> eigenvalues_double;

    MATRIX_3X3<double> eigenvectors_double;

    eigenvalues = eigenvalues_double;

    eigenvectors = eigenvectors_double;

  }

};


The error messages I receive are:

./matrix.hpp: 11:33: error: implicit instantiation of undefined template
‘DIAGONAL_MATRIX_3X3<double>’

./matrix.hpp: 2:25: note: template is declared here

./matrix.hpp:12:24: error: implicit instantiation of undefined template
‘MATRIX_3X3<double>’

./matrix.hpp:1:25: note: template is declared here

2 errors generated


Is there something I am missing - or a way to modify this code to make it
compile with clang++?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20140417/599f045b/attachment.html>


More information about the cfe-users mailing list