From 25c7d9164f45119fa20dc6af2fa451d278c5f285 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 18 Dec 2014 22:58:15 +0100 Subject: [PATCH] bug #920: fix MSVC 2015 compilation issues --- Eigen/src/Core/MapBase.h | 11 +++++------ Eigen/src/Core/util/Macros.h | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index 5d51548cd..1589cbaae 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -172,6 +172,7 @@ template class MapBase template class MapBase : public MapBase { + typedef MapBase ReadOnlyMapBase; public: typedef MapBase Base; @@ -239,15 +240,13 @@ template class MapBase EIGEN_DEVICE_FUNC Derived& operator=(const MapBase& other) { - Base::Base::operator=(other); + ReadOnlyMapBase::Base::operator=(other); return derived(); } - // In theory MapBase should not make a using Base::operator=, - // and thus we should directly do: using Base::Base::operator=; - // However, this would confuse recent MSVC 2013 (bug 821), and since MapBase - // has operator= to make ICC 11 happy, we can also make MSVC 2013 happy as follow: - using Base::operator=; + // In theory we could simply refer to Base:Base::operator=, but MSVC does not like Base::Base, + // see bugs 821 and 920. + using ReadOnlyMapBase::Base::operator=; }; #undef EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index bc26043d7..687ba41dd 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -73,7 +73,7 @@ /// \internal EIGEN_COMP_MSVC_STRICT set to 1 if the compiler is really Microsoft Visual C++ and not ,e.g., ICC #if EIGEN_COMP_MSVC && !(EIGEN_COMP_ICC) - #define EIGEN_COMP_MSVC_STRICT 1 + #define EIGEN_COMP_MSVC_STRICT _MSC_VER #else #define EIGEN_COMP_MSVC_STRICT 0 #endif @@ -592,7 +592,7 @@ namespace Eigen { // just an empty macro ! #define EIGEN_EMPTY -#if EIGEN_COMP_MSVC_STRICT +#if EIGEN_COMP_MSVC_STRICT && EIGEN_COMP_MSVC < 1900 #define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \ using Base::operator =; #elif EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)