From 5bc21c25c5b0b5fc3a54104e5058eb8c064ce3a3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 10 Dec 2010 09:59:44 +0100 Subject: [PATCH] fix ICE with gcc 3.4 and 4.0.1 --- Eigen/src/Geometry/Transform.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 8bc2f41bd..f7c3bd376 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -211,6 +211,11 @@ public: typedef Block TranslationPart; /** corresponding translation type */ typedef Translation TranslationType; + + // this intermediate enum is needed to avoid an ICE with gcc 3.4 and 4.0 + enum { TransformTimeDiagonalMode = ((Mode==int(Isometry))?Affine:int(Mode)) }; + /** The return type of the product between a diagonal matrix and a transform */ + typedef Transform TransformTimeDiagonalReturnType; protected: @@ -381,10 +386,10 @@ public: * mode is no isometry. In that case, the returned transform is an affinity. */ template - inline const Transform + inline const TransformTimeDiagonalReturnType operator * (const DiagonalBase &b) const { - Transform res(*this); + TransformTimeDiagonalReturnType res(*this); res.linear() *= b; return res; } @@ -396,10 +401,10 @@ public: * mode is no isometry. In that case, the returned transform is an affinity. */ template - friend inline const Transform + friend inline TransformTimeDiagonalReturnType operator * (const DiagonalBase &a, const Transform &b) { - Transform res; + TransformTimeDiagonalReturnType res; res.linear().noalias() = a*b.linear(); res.translation().noalias() = a*b.translation(); if (Mode!=int(AffineCompact))