Re: [eigen] clang-3.1 issue

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


Indeed, that looks like a clang bug. I've no idea how to workaround it.

gael

On Wed, Jun 13, 2012 at 1:21 PM, Benjamin Schindler
<bschindler@xxxxxxxxxxx> wrote:
> Hi
>
> I just stumbled over this issue, may be you have some input on it, but
> I'm really thinking I have found a clang bug. Consider the attached code
> (I used latest tip of Eigen). It fails to compile with
>
> test.cpp:11:18: error: use of overloaded operator '=' is ambiguous (with
> operand types 'typename FixedSegmentReturnType<3>::Type' (aka
> 'VectorBlock<Eigen::Matrix<float, 4, 1, 0, 4, 1>, 3>') and 'const
> ConstantReturnType' (aka 'const
>      CwiseNullaryOp<internal::scalar_constant_op<Scalar>,
> Eigen::Matrix<float, 3, 1, 0, 3, 1> >'))
>        input.head<3>() = Vector3f::Zero();
>        ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
> test.cpp:17:2: note: in instantiation of function template
> specialization 'myFunction<float>' requested here
>        myFunction<float>();
>        ^
> /local/bschindler/projects/eigen/Eigen/src/Core/MatrixBase.h:169:14:
> note: candidate function [with OtherDerived =
> Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<float>,
> Eigen::Matrix<float, 3, 1, 0, 3, 1> >]
>    Derived& operator=(const DenseBase<OtherDerived>& other);
>             ^
> /local/bschindler/projects/eigen/Eigen/src/Core/MatrixBase.h:172:14:
> note: candidate function [with OtherDerived =
> Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<float>,
> Eigen::Matrix<float, 3, 1, 0, 3, 1> >]
>    Derived& operator=(const EigenBase<OtherDerived>& other);
>
>
> Now, If I move lines 10 and 11 into the main function it compiles.
> clang bug?
>
> Cheers
> Benjamin



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