New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 543 - compile error with assignment operator overloads using XCode clang 421.11.66 compiler
Summary: compile error with assignment operator overloads using XCode clang 421.11.66 ...
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.1
Hardware: x86 - 64-bit Mac OS
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-20 13:08 UTC by Gerhard
Modified: 2013-01-22 08:16 UTC (History)
2 users (show)



Attachments
test example (188 bytes, application/octet-stream)
2013-01-20 13:08 UTC, Gerhard
no flags Details

Description Gerhard 2013-01-20 13:08:58 UTC
Created attachment 311 [details]
test example

Hi,

Compiling the attached simple test case fails with an ambiguous overload:

error: use of overloaded operator '=' is ambiguous (with operand types 'Block<Eigen::Matrix<double, 4, 4, 0, 4, 4>, 3, 1>' and 'Vector3d' (aka 'Matrix<double, 3, 1>'))
    m.block<3,1>(0,0) = v;

eigen.cpp:14:5: note: in instantiation of function template specialization 'test<1>' requested here
    test<1>();
    ^
/opt/local/include/eigen3/Eigen/src/Core/MatrixBase.h:154:14: note: candidate function [with OtherDerived = Eigen::Matrix<double, 3, 1, 0, 3, 1>]
    Derived& operator=(const DenseBase<OtherDerived>& other);
             ^
/opt/local/include/eigen3/Eigen/src/Core/MatrixBase.h:157:14: note: candidate function [with OtherDerived = Eigen::Matrix<double, 3, 1, 0, 3, 1>]
    Derived& operator=(const EigenBase<OtherDerived>& other);
             ^

It works with the gcc front end, or if the function is not a template function.

cheers,
  Gerhard
Comment 1 Gael Guennebaud 2013-01-22 08:16:38 UTC
Works for me with:
* Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
* Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
* clang version 3.1
* clang version 3.2
* clang version 3.3

Note You need to log in before you can comment on or make changes to this bug.