diff --git a/src/OpenFOAM/memory/tmp/tmp.H b/src/OpenFOAM/memory/tmp/tmp.H
index 28d6fb50f36828d12847b139d3836c6e6790f7ae..6a145158a785c15f3b8b9748123e2fbbe8121d55 100644
--- a/src/OpenFOAM/memory/tmp/tmp.H
+++ b/src/OpenFOAM/memory/tmp/tmp.H
@@ -124,7 +124,7 @@ public:
 
             //- Return non-const reference or generate a fatal error
             //  if the object is const.
-            inline T& ref();
+            inline T& ref() const;
 
             //- Return tmp pointer for reuse.
             //  Returns a clone if the object is not a temporary
diff --git a/src/OpenFOAM/memory/tmp/tmpI.H b/src/OpenFOAM/memory/tmp/tmpI.H
index b1add8e8c3afb9cad7cec960550c2c83cb46b04d..e08214bcd13a649e1f60ac6c0e0129a9f12a5a1b 100644
--- a/src/OpenFOAM/memory/tmp/tmpI.H
+++ b/src/OpenFOAM/memory/tmp/tmpI.H
@@ -158,7 +158,7 @@ inline Foam::word Foam::tmp<T>::typeName() const
 
 
 template<class T>
-inline T& Foam::tmp<T>::ref()
+inline T& Foam::tmp<T>::ref() const
 {
     if (isTmp())
     {