From 752ab418c96412ee0fae9cea7f6518ce4a32240b Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin <kutalmis.bercin@esi-group.com> Date: Thu, 11 Apr 2024 09:31:27 +0100 Subject: [PATCH] COMP: avoid ambiguous type conversion in Clang (fixes #3138) --- src/OpenFOAM/primitives/traits/oneI.H | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OpenFOAM/primitives/traits/oneI.H b/src/OpenFOAM/primitives/traits/oneI.H index 8d1d08b6290..4ff522c9d36 100644 --- a/src/OpenFOAM/primitives/traits/oneI.H +++ b/src/OpenFOAM/primitives/traits/oneI.H @@ -94,7 +94,7 @@ inline constexpr const one& operator/(const one& o, const one&) noexcept template<class Type> inline Type operator/(const one&, const Type& val) { - return scalar(1)/val; + return Type(scalar(1)/val); } template<class Type> @@ -111,13 +111,13 @@ inline constexpr const one& min(const one& o, const one&) noexcept template<class Type> inline Type min(const one&, const Type& t) noexcept { - return min(scalar(1), t); + return Type(min(scalar(1), t)); } template<class Type> inline Type min(const Type& t, const one&) noexcept { - return min(t, scalar(1)); + return Type(min(t, scalar(1))); } inline constexpr const one& max(const one& o, const one&) noexcept @@ -128,13 +128,13 @@ inline constexpr const one& max(const one& o, const one&) noexcept template<class Type> inline Type max(const one&, const Type& t) noexcept { - return max(scalar(1), t); + return Type(max(scalar(1), t)); } template<class Type> inline Type max(const Type& t, const one&) noexcept { - return max(t, scalar(1)); + return Type(max(t, scalar(1))); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -- GitLab