[eigen] weird template stuff confuses clang |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hello,
I have one last thing to fix to get clang compiles eigen again. I'm kinda lost, so here are the details. First, note that eigen used to compile with clang, until commit 82bf6ba3c9d5 by gael. The interesting file is Eigen/src/Core/VectorwiseOp.h
This commit changes the signature of ReturnType (line ~170) from
template<template<typename _Scalar> class Functor> struct ReturnType;
to
template<template<typename _Scalar> class Functor, typename Scalar=typename ei_traits<ExpressionType>::Scalar> struct ReturnType;
And this is where clang crashes (it actually crashes, signal11).
If i revert the patch, it compiles again. Starting from such a state. We have then
template<template<typename _Scalar> class Functor> struct ReturnType;
If i change this to
template<template<typename _Scalar> class Functor, typename asdf> struct ReturnType;
it crashes again
If instead I do
template<template<typename> class Functor, typename afefScalar=int > struct ReturnType
it compiles ok but... this one fails again:
template<template<typename> class Functor, typename afefScalar= typename ei_traits<ExpressionType>::Scalar > struct ReturnType
From there i dont know. At first i thought it was just a clang bug... but now i'm not sure.
As a side note (but this is unrelated), the same name 'Scalar' is used to define a typedef in the class and as template name for ReturnType, which is kind unfortunate i guess.
If you have any idea.
Thomas
--
Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
http://www.freehackers.org/thomas