Re: [eigen] clang-3.1 issue |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] clang-3.1 issue
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 13 Jun 2012 20:27:29 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=zrZNYxuQabMGReYgfN+BlAr+7JemUNrHMl2ktHaIPvY=; b=Y8TUWgDqlfdexq6RyasJs8dDvFfwOpJ/fp+sc30UM4qXkNABN8xRAtshfhOCHmLobk 87YhfWjc24pnOY/N9z9ZP2zTjAlfP4/A8VNpgZbTLC76pRyIecohgIuXsCgmhyfDhEUd 6l0MyLdiu4Bwr0vHsGxZ3rZKCGnQNHJCwFAuYOgmukVAzAAg+PgCOD46UbTMhUNAAyp0 okAcrGWslCGzXFgt9RGzXQDz2NKj+Kxo3klX5c7248VDba/3JdZYKHsB0j99MxGmfYzU reK9LKpUs5fw/UIZzHscFHAzUrIbU38C0/QXmCrxRatGdp8NrMAIorIX7fCgZHGqE715 R0aw==
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