From f40d7ef578ddc7ef04c6ba534ba3d23213eff6f9 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 9 May 2018 12:40:38 +0200
Subject: [PATCH] COMP: use emptyLabelList to avoid reference to temporary (gcc
 8.1)

---
 .../coordinateSystems/coordinateRotation/cylindrical.C      | 4 ++--
 .../coordinateSystems/coordinateRotation/cylindrical.H      | 3 ++-
 src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H        | 5 +++--
 src/surfMesh/meshedSurf/meshedSurfRef.H                     | 6 +++---
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C
index de8b54f4024..17303cf7a50 100644
--- a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C
+++ b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.C
@@ -54,7 +54,7 @@ namespace Foam
 void Foam::cylindrical::init
 (
     const objectRegistry& obr,
-    const List<label>& cells
+    const labelUList& cells
 )
 {
     const polyMesh& mesh = refCast<const polyMesh>(obr);
@@ -196,7 +196,7 @@ void Foam::cylindrical::updateCells
 
     forAll(cells, i)
     {
-        label celli = cells[i];
+        const label celli = cells[i];
         vector dir = cc[celli] - origin_;
         dir /= mag(dir) + VSMALL;
 
diff --git a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H
index 1c3cd012cf1..9f7a2463e72 100644
--- a/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H
+++ b/src/meshTools/coordinateSystems/coordinateRotation/cylindrical.H
@@ -52,6 +52,7 @@ SourceFiles
 
 #include "point.H"
 #include "vector.H"
+#include "ListOps.H"
 #include "coordinateRotation.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -85,7 +86,7 @@ class cylindrical
         void init
         (
             const objectRegistry& obr,
-            const List<label>& cells = List<label>()
+            const labelUList& cells = Foam::emptyLabelList
         );
 
 
diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H
index ae3363984a6..6b830147500 100644
--- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H
+++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016-2017 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2018 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -40,6 +40,7 @@ SourceFiles
 #include "pointField.H"
 #include "labelledTri.H"
 #include "HashSet.H"
+#include "ListOps.H"
 #include "surfZoneList.H"
 #include "surfaceFormatsCore.H"
 #include "runTimeSelectionTables.H"
@@ -101,7 +102,7 @@ public:
             const pointField& pointLst,
             const UList<Face>& faceLst,
             const UList<surfZone>& zoneLst = List<surfZone>(),
-            const labelUList& faceMap = List<label>()
+            const labelUList& faceMap = Foam::emptyLabelList
         );
 
 
diff --git a/src/surfMesh/meshedSurf/meshedSurfRef.H b/src/surfMesh/meshedSurf/meshedSurfRef.H
index a69cf87c0fa..a0a15b8df05 100644
--- a/src/surfMesh/meshedSurf/meshedSurfRef.H
+++ b/src/surfMesh/meshedSurf/meshedSurfRef.H
@@ -54,10 +54,10 @@ class meshedSurfRef
 
     // Private Member Functions
 
-        //- Disallow construct as copy
+        //- No copy construct
         meshedSurfRef(const meshedSurfRef&) = delete;
 
-        //- Disallow default bitwise assignment
+        //- No copy construct assignment
         void operator=(const meshedSurfRef&) = delete;
 
 public:
@@ -69,7 +69,7 @@ public:
         (
             const pointField& pts,
             const faceList& faces,
-            const labelList& ids = Foam::emptyLabelList
+            const labelUList& ids = Foam::emptyLabelList
         )
         :
             points_(pts),
-- 
GitLab