This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 537 - Fails to compile XCode clang 421.11.66 compiler
Summary: Fails to compile XCode clang 421.11.66 compiler
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: 3.1
Hardware: x86 - general Mac OS
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-20 13:22 UTC by Alexey Pelykh
Modified: 2019-12-04 11:59 UTC (History)
4 users (show)



Attachments
A fix tentative (786 bytes, application/octet-stream)
2012-12-20 15:08 UTC, Gael Guennebaud
no flags Details
Patch for Bug 537 (475 bytes, patch)
2016-03-01 18:16 UTC, Aaron Marburg
no flags Details | Diff

Description Alexey Pelykh 2012-12-20 13:22:04 UTC
Quaternion.h contains following line
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(IsAligned)
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.
Comment 1 Gael Guennebaud 2012-12-20 15:08:00 UTC
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.
Comment 2 Aaron Marburg 2016-03-01 18:11:20 UTC
I can replicate this error (still!) with the stable (hq 3.2) branch given trivial test code:

#include <Eigen/Geometry>
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)
Target: x86_64-apple-darwin15.3.0
Thread model: posix
Comment 3 Aaron Marburg 2016-03-01 18:16:14 UTC
Created attachment 663 [details]
Patch for Bug 537

Resolves the bug by casting IsAligned to (bool) in the macro.
Comment 4 Gael Guennebaud 2016-03-02 12:24:50 UTC
I cannot reproduce with "Apple LLVM version 7.0.0 (clang-700.1.76)", anyway, those fixes are harmless:

3.2: https://bitbucket.org/eigen/eigen/commits/c45fbc03e711/
devel: https://bitbucket.org/eigen/eigen/commits/0439395336bc/
Comment 5 Nobody 2019-12-04 11:59:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/537.

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