Re: [eigen] weird template stuff confuses clang

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


That's called "template template parameters". They're part of c++98
and have been supported by major compilers for a while. Clang++ is
still young, I'm sure it will support them soon!

http://www.informit.com/articles/article.aspx?p=376878
http://stackoverflow.com/questions/213761/what-are-some-uses-of-template-template-parameters-in-c

Since you have a clang crash, I'm sure that if you report it to clang
devs, they'll take care of it. Try to figure how to generate the
preprocessed source with clang so you can give them a self-contained
test case.

Benoit

2010/7/5 Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>:
>
> 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
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/