New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 967 - Lots of failing unit tests when compiling with -std=c++11
Summary: Lots of failing unit tests when compiling with -std=c++11
Alias: None
Product: Eigen
Classification: Unclassified
Component: General (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Highest Compilation Problem
Assignee: Nobody
Depends on:
Blocks: 3.3 966
  Show dependency treegraph
Reported: 2015-02-19 20:34 UTC by Christoph Hertzberg
Modified: 2015-02-21 20:40 UTC (History)
3 users (show)


Description Christoph Hertzberg 2015-02-19 20:34:19 UTC
Although I could not reproduce Bug 966, I found lots of unit tests that failed to compile in C++11 mode.
Also, currently building (everything) in C++11 mode requires some manual flag settings:


We could set that flag automatically (and modify the BUILD_STRING) whenever EIGEN_TEST_CXX11 is activated.
The old EIGEN_TEST_C++0x only works for g++, and I'd vote for deprecating (or entirely removing) it.
Comment 1 Gael Guennebaud 2015-02-19 22:12:07 UTC
arf, I've been confused myself with EIGEN_TEST_CXX11. I assumed it added -std=c++11 everywhere, so yes having EIGEN_TEST_CXX11 => EIGEN_TEST_CUSTOM_CXX_FLAGS=-std=c++11 is probably a good idea.

I also agree that EIGEN_TEST_C++0x should be removed.
Comment 2 Gael Guennebaud 2015-02-19 23:11:35 UTC
My local fix consists in defining internal::result_of as follow in C++11:

template<typename T> struct result_of {
  typedef typename std::result_of<T>::type type1;
  typedef typename remove_all<type1>::type type;

This change allowed me to find a few situations where we instantiated result_of<Func(arg)> on binary functors!

Still a few issues to fix before committing.
Comment 3 Gael Guennebaud 2015-02-20 08:00:30 UTC
Summary:     Fix some calls to result_of on binary functors as unary ones.
Summary:     Fix a C++11 compilation issue in unit test
Summary:     Fix regression with C++11 support of lambda: now internal::result_of falls back to std::result_of in C++11.

Still have to update the CMake stuff....
Comment 4 Gael Guennebaud 2015-02-20 09:35:42 UTC
Summary:     Remove EIGEN_TEST_C++0x option and let EIGEN_TEST_CXX11 adds the -std=c++11 flag
Comment 5 Christoph Hertzberg 2015-02-21 20:40:50 UTC
There were two issues left, which I fixed here:

Furthermore, we now have lots of deprecation warnings for binder1st and binder2nd. As far as I can see, they are only used for comparison operators, which should get replaced in order to solve Bug 97, eventually.

Also: Shall we automatically add a build string suffix when compiling in C++11 mode? (or when compiling in C++03 mode, if C++11 becomes default?)

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