From f3b95df7b928de19a5ffbb27f1a3908839392f0d Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 21 Dec 2010 15:43:07 +0100 Subject: [PATCH] COMP: undefined operator==(const objectHit&, const objectHit&) with clang - real bug or compiler bug? --- .../primitiveShapes/objectHit/objectHit.H | 20 ++++++------------- src/meshTools/indexedOctree/labelBits.H | 8 ++++---- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H index 61ee023ea3..c19b5ca8c3 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H +++ b/src/OpenFOAM/meshes/primitiveShapes/objectHit/objectHit.H @@ -40,14 +40,6 @@ Description namespace Foam { -// Forward declaration of friend functions and operators - -class objectHit; -inline bool operator==(const objectHit&, const objectHit&); -inline bool operator!=(const objectHit&, const objectHit&); -inline Ostream& operator<<(Ostream&, const objectHit&); - - /*---------------------------------------------------------------------------*\ Class objectHit Declaration \*---------------------------------------------------------------------------*/ @@ -106,22 +98,22 @@ public: // Friend Operators - friend bool operator==(const objectHit& a, const objectHit& b) + inline friend bool operator==(const objectHit& a, const objectHit& b) { - return ((a.hit_ == b.hit_) && (a.hitObject_ == b.hitObject_)); + return (a.hit_ == b.hit_) && (a.hitObject_ == b.hitObject_); } - friend bool operator!=(const objectHit& a, const objectHit& b) + inline friend bool operator!=(const objectHit& a, const objectHit& b) { - return (!(a == b)); + return !(a == b); } // Ostream operator - friend Ostream& operator<<(Ostream& os, const objectHit& b) + inline friend Ostream& operator<<(Ostream& os, const objectHit& obj) { - return os << b.hit() << token::SPACE << b.hitObject(); + return os << obj.hit() << token::SPACE << obj.hitObject(); } }; diff --git a/src/meshTools/indexedOctree/labelBits.H b/src/meshTools/indexedOctree/labelBits.H index d25ab4ab23..ab2a71274b 100644 --- a/src/meshTools/indexedOctree/labelBits.H +++ b/src/meshTools/indexedOctree/labelBits.H @@ -118,24 +118,24 @@ public: // Member Operators - friend inline bool operator==(const labelBits& a, const labelBits& b) + inline friend bool operator==(const labelBits& a, const labelBits& b) { return a.data_ == b.data_; } - friend inline bool operator!=(const labelBits& a, const labelBits& b) + inline friend bool operator!=(const labelBits& a, const labelBits& b) { return !(a == b); } // IOstream Operators - friend inline Istream& operator>>(Istream& is, labelBits& lb) + inline friend Istream& operator>>(Istream& is, labelBits& lb) { return is >> lb.data_; } - friend inline Ostream& operator<<(Ostream& os, const labelBits& lb) + inline friend Ostream& operator<<(Ostream& os, const labelBits& lb) { return os << lb.data_; }