From 5ee25a5af0f0cd50d2a46287cbbc9eab68ed1fca Mon Sep 17 00:00:00 2001 From: Janis Born Date: Thu, 11 Aug 2016 10:22:44 +0200 Subject: [PATCH] fix CirculatorT type-pun warning on GCC6 (fixes #28) --- src/OpenMesh/Core/Mesh/CirculatorsT.hh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/CirculatorsT.hh b/src/OpenMesh/Core/Mesh/CirculatorsT.hh index 1bf8cb4c..06560599 100644 --- a/src/OpenMesh/Core/Mesh/CirculatorsT.hh +++ b/src/OpenMesh/Core/Mesh/CirculatorsT.hh @@ -314,13 +314,15 @@ class GenericCirculatorT : protected GenericCirculatorBaseT { /// Standard dereferencing operator. value_type operator*() const { + // We can't use this due to a GCC6 compiler bug + const GenericCirculatorBaseT* self = this; #ifndef NDEBUG assert(this->heh_.is_valid()); - value_type res = (this->*Handle2Value)(); + value_type res = (self->*Handle2Value)(); assert(res.is_valid()); return res; #else - return (this->*Handle2Value)(); + return (self->*Handle2Value)(); #endif } @@ -498,13 +500,15 @@ class GenericCirculatorT_DEPRECATED : protected GenericCirculatorBaseT { /// Standard dereferencing operator. value_type operator*() const { + // We can't use this due to a GCC6 compiler bug + const GenericCirculatorBaseT* self = this; #ifndef NDEBUG assert(this->heh_.is_valid()); - value_type res = (this->*Handle2Value)(); + value_type res = (self->*Handle2Value)(); assert(res.is_valid()); return res; #else - return (this->*Handle2Value)(); + return (self->*Handle2Value)(); #endif }