Defaulted quaternion move constructors make clang compilation fail
Submitted by Jan Carius
Assigned to Nobody
Link to original bugzilla bug (#1575)
Version: 3.3 (current stable)
Description
Programs that use a quaternion with a base scalar type that is not noexcept constructable/movable fail to compile with clang++. The errors are
Eigen/src/Geometry/Quaternion.h:111:28: error: exception specification of explicitly defaulted move constructor does not match the calculated one
EIGEN_DEVICE_FUNC inline QuaternionBase(QuaternionBase&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value) = default;
Eigen/src/Geometry/Quaternion.h:114:37: error: exception specification of explicitly defaulted move assignment operator does not match the calculated one
EIGEN_DEVICE_FUNC QuaternionBase& operator=(QuaternionBase&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value) = default;
This happens in particular for users that want to use a quaternion in conjunction with an auto-diff library (whose types are more complex than just doubles/floats).
Temporary workaround: Remove the EIGEN_NOEXCEPT_IF(...) macro.
Related articles:
https://stackoverflow.com/questions/20610658/defaulted-move-assignment-cannot-be-explicitly-noexcept-if-a-member-has-a-non-tr
https://akrzemi1.wordpress.com/2015/09/11/declaring-the-move-constructor/
System specs:
OS: Ubuntu 16.04
Clang++ version 3.8