Bugzilla – Bug 537
Fails to compile XCode clang 421.11.66 compiler
Last modified: 2016-03-02 12:24:50 UTC
Quaternion.h contains following line
and IsAligned with value of 0 and compiler complains in mismatched types in template arguments. Probably should be replaced by
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(IsAligned == 0)
to evaluate to 'true' when IsAligned is 0, or false.
Created attachment 307 [details]
A fix tentative
I think this patch should be enough, and needed anyway. If not adding bool(IsAligned) (and not IsAligned==0 !!!) will be the solution.
I can replicate this error (still!) with the stable (hq 3.2) branch given trivial test code:
template class Eigen::Quaternion<double>;
when compiled with Apple's compiler using either the "-std=c++11" or "-std=c++0x" flags. When the -std is not specified, the code compiles.
I discovered this problem under the version of 3.2.8 distributed by homebrew, but have confirmed it in hg. hg head does not have this bug.
This is current XCode tools under OSX 10.11.3:
% g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Thread model: posix
Created attachment 663 [details]
Patch for Bug 537
Resolves the bug by casting IsAligned to (bool) in the macro.
I cannot reproduce with "Apple LLVM version 7.0.0 (clang-700.1.76)", anyway, those fixes are harmless: