From aa1e1eb15d9539f8664dfddb8cd0e1ce0e2f9d3b Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 27 Jan 2021 09:41:49 +0100
Subject: [PATCH] COMP: fix inline friend declarations (gcc-4.8.5)

---
 .../solvers/electromagnetics/magneticFoam/magnet.H  |  6 +-----
 .../containers/Lists/DynamicList/DynamicList.H      |  4 ++--
 src/OpenFOAM/db/IOstreams/output/FlatOutput.H       |  7 +++----
 .../fields/Fields/DynamicField/DynamicField.H       |  4 ++--
 .../meshes/meshShapes/labelledTri/labelledTri.H     |  8 ++++----
 .../polyMesh/mapPolyMesh/objectMap/objectMap.H      |  2 +-
 src/OpenFOAM/meshes/primitiveShapes/line/line.H     |  8 +-------
 .../primitiveShapes/objectHit/PointIndexHit.H       |  4 ++--
 .../primitiveShapes/tetrahedron/tetrahedron.H       |  8 +++-----
 .../meshes/primitiveShapes/triangle/triangle.H      |  4 +---
 src/OpenFOAM/primitives/triad/triad.H               | 13 +++++--------
 src/fileFormats/stl/STLtriangle.H                   |  8 ++++----
 12 files changed, 29 insertions(+), 47 deletions(-)

diff --git a/applications/solvers/electromagnetics/magneticFoam/magnet.H b/applications/solvers/electromagnetics/magneticFoam/magnet.H
index 9d327351adb..fb95b980c2c 100644
--- a/applications/solvers/electromagnetics/magneticFoam/magnet.H
+++ b/applications/solvers/electromagnetics/magneticFoam/magnet.H
@@ -44,11 +44,7 @@ SourceFiles
 namespace Foam
 {
 
-// Forward declaration of classes
-class Istream;
-class Ostream;
-
-// Forward declaration of friend functions and operators
+// Forward Declarations
 class magnet;
 Istream& operator>>(Istream&, magnet&);
 Ostream& operator<<(Ostream&, const magnet&);
diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
index 6ba6fec7d0e..5060385a012 100644
--- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
+++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H
@@ -337,14 +337,14 @@ public:
     // IOstream Operators
 
         //- Read from Istream, discarding existing contents
-        inline friend Istream& operator>> <T, SizeMin>
+        friend Istream& operator>> <T, SizeMin>
         (
             Istream& is,
             DynamicList<T, SizeMin>& rhs
         );
 
         //- Write to Ostream
-        inline friend Ostream& operator<< <T, SizeMin>
+        friend Ostream& operator<< <T, SizeMin>
         (
             Ostream& os,
             const DynamicList<T, SizeMin>& rhs
diff --git a/src/OpenFOAM/db/IOstreams/output/FlatOutput.H b/src/OpenFOAM/db/IOstreams/output/FlatOutput.H
index 399dd081bdb..5abbc3de9ce 100644
--- a/src/OpenFOAM/db/IOstreams/output/FlatOutput.H
+++ b/src/OpenFOAM/db/IOstreams/output/FlatOutput.H
@@ -54,8 +54,8 @@ template<class Container, class Delimiters> class OutputAdaptor;
 template<class Container, class Delimiters>
 inline Ostream& operator<<
 (
-    Ostream&,
-    const FlatOutput::OutputAdaptor<Container, Delimiters>&
+    Ostream& os,
+    const FlatOutput::OutputAdaptor<Container, Delimiters>& adaptor
 );
 
 
@@ -187,8 +187,7 @@ public:
     // Operators
 
         //- Ostream Operator
-        inline friend Ostream&
-        operator<<
+        friend Ostream& operator<<
         (
             Ostream& os,
             const OutputAdaptor<Container, Delimiters>& adaptor
diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H
index ce84afae414..0330f968d31 100644
--- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H
+++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H
@@ -271,14 +271,14 @@ public:
     // IOstream Operators
 
         //- Read from Istream, discarding existing contents
-        inline friend Istream& operator>> <T, SizeMin>
+        friend Istream& operator>> <T, SizeMin>
         (
             Istream& is,
             DynamicField<T, SizeMin>& rhs
         );
 
         //- Write to Ostream
-        inline friend Ostream& operator<< <T, SizeMin>
+        friend Ostream& operator<< <T, SizeMin>
         (
             Ostream& os,
             const DynamicField<T, SizeMin>& rhs
diff --git a/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H b/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H
index 039ef49bddf..0d0f20985b9 100644
--- a/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H
+++ b/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H
@@ -48,8 +48,8 @@ namespace Foam
 
 // Forward Declarations
 class labelledTri;
-Istream& operator>>(Istream&, labelledTri&);
-Ostream& operator<<(Ostream&, const labelledTri&);
+inline Istream& operator>>(Istream&, labelledTri&);
+inline Ostream& operator<<(Ostream&, const labelledTri&);
 
 /*---------------------------------------------------------------------------*\
                            Class labelledTri Declaration
@@ -119,8 +119,8 @@ public:
 
     // IOstream Operators
 
-        inline friend Istream& operator>>(Istream&, labelledTri&);
-        inline friend Ostream& operator<<(Ostream&, const labelledTri&);
+        friend Istream& operator>>(Istream&, labelledTri&);
+        friend Ostream& operator<<(Ostream&, const labelledTri&);
 };
 
 
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H
index f7ace81e86e..676ae137297 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/objectMap/objectMap.H
@@ -45,7 +45,7 @@ SourceFiles
 namespace Foam
 {
 
-// Forward declarations
+// Forward Declarations
 
 class objectMap;
 inline bool operator==(const objectMap& a, const objectMap& b);
diff --git a/src/OpenFOAM/meshes/primitiveShapes/line/line.H b/src/OpenFOAM/meshes/primitiveShapes/line/line.H
index 612ddbfe554..caf65ef76cd 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/line/line.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/line/line.H
@@ -49,13 +49,7 @@ SourceFiles
 namespace Foam
 {
 
-// Forward declaration of classes
-
-class Istream;
-class Ostream;
-
-
-// Forward declaration of friend functions and operators
+// Forward Declarations
 
 template<class Point, class PointRef> class line;
 
diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H
index 5cc86d3e61a..7337b865479 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H
@@ -280,13 +280,13 @@ public:
         {
             if (is.format() == IOstream::ASCII)
             {
-                return is >> pHit.hit_ >> pHit.point_ >> pHit.index_;
+                is >> pHit.hit_ >> pHit.point_ >> pHit.index_;
             }
             else
             {
                 // TODO (2019-08-06):
                 // cannot properly handle mixed-precision reading
-                // owning to bool and Point type.
+                // owing to bool and Point type.
 
                 is.read
                 (
diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H
index 01c5e3e4d3f..6471c3d9103 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedron.H
@@ -57,11 +57,9 @@ SourceFiles
 namespace Foam
 {
 
-// Forward declarations
-class Istream;
-class Ostream;
-class tetPoints;
+// Forward Declarations
 class plane;
+class tetPoints;
 
 template<class Point, class PointRef> class tetrahedron;
 
@@ -310,7 +308,7 @@ public:
             boundBox bounds() const;
 
 
-    // IOstream operators
+    // IOstream Operators
 
         friend Istream& operator>> <Point, PointRef>
         (
diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
index e4eb46dc06f..b25ccf87244 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
@@ -54,8 +54,6 @@ namespace Foam
 {
 
 // Forward Declarations
-class Istream;
-class Ostream;
 class plane;
 class triPoints;
 
@@ -355,7 +353,7 @@ public:
             ) const;
 
 
-    // IOstream operators
+    // IOstream Operators
 
         friend Istream& operator>> <Point, PointRef>
         (
diff --git a/src/OpenFOAM/primitives/triad/triad.H b/src/OpenFOAM/primitives/triad/triad.H
index 27491da9c62..b158b425314 100644
--- a/src/OpenFOAM/primitives/triad/triad.H
+++ b/src/OpenFOAM/primitives/triad/triad.H
@@ -52,13 +52,11 @@ SourceFiles
 namespace Foam
 {
 
-// Forward declarations
+// Forward Declarations
 class triad;
 class quaternion;
-class Istream;
-class Ostream;
-Istream& operator>>(Istream&, triad&);
-Ostream& operator<<(Ostream&, const triad&);
+inline Istream& operator>>(Istream&, triad&);
+inline Ostream& operator<<(Ostream&, const triad&);
 
 /*---------------------------------------------------------------------------*\
                            Class triad Declaration
@@ -68,7 +66,6 @@ class triad
 :
     public Vector<vector>
 {
-
 public:
 
     // Constructors
@@ -160,8 +157,8 @@ public:
 
     // IOstream Operators
 
-        inline friend Istream& operator>>(Istream&, triad&);
-        inline friend Ostream& operator<<(Ostream&, const triad&);
+        friend Istream& operator>>(Istream&, triad&);
+        friend Ostream& operator<<(Ostream&, const triad&);
 };
 
 
diff --git a/src/fileFormats/stl/STLtriangle.H b/src/fileFormats/stl/STLtriangle.H
index 318addf4f61..c8e49a23c99 100644
--- a/src/fileFormats/stl/STLtriangle.H
+++ b/src/fileFormats/stl/STLtriangle.H
@@ -47,9 +47,9 @@ SourceFiles
 namespace Foam
 {
 
-// Forward declaration of friend functions and operators
+// Forward Declarations
 class STLtriangle;
-Ostream& operator<<(Ostream& os, const STLtriangle& tri);
+inline Ostream& operator<<(Ostream& os, const STLtriangle& tri);
 
 /*---------------------------------------------------------------------------*\
                          Class STLtriangle Declaration
@@ -141,10 +141,10 @@ public:
             );
 
 
-    // Ostream operator
+    // Ostream Operator
 
         //- Print triangle contents
-        inline friend Ostream& operator<<(Ostream& os, const STLtriangle& tri);
+        friend Ostream& operator<<(Ostream& os, const STLtriangle& tri);
 };
 
 
-- 
GitLab