From cab9bc8fba8f48be0e469a7097cd4914a4f617d9 Mon Sep 17 00:00:00 2001 From: Glen Mabey Date: Thu, 4 May 2017 01:33:12 +0000 Subject: Eliminate ambiguous casts involving qfloat16 The operator double() and operator long double() members of qfloat16 are causing cast ambiguities. This removes them, leaving only operator float() which seems to be adequate. Also, additional arithmetic operator tests were added which without this removal fail to compile. Change-Id: Id52a101b318fd754969b3de13c1e528d0aac2387 Reviewed-by: Thiago Macieira --- src/corelib/global/qfloat16.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/corelib/global/qfloat16.h') diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index b0272c51c3..054d503249 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -62,8 +62,6 @@ public: Q_DECL_CONSTEXPR inline qfloat16() Q_DECL_NOTHROW : b16(0) { } inline qfloat16(float f) Q_DECL_NOTHROW; inline operator float() const Q_DECL_NOTHROW; - inline operator double() const Q_DECL_NOTHROW; - inline operator long double() const Q_DECL_NOTHROW; #endif private: @@ -153,16 +151,6 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW #endif } -inline qfloat16::operator double() const Q_DECL_NOTHROW -{ - return static_cast(float(*this)); -} - -inline qfloat16::operator long double() const Q_DECL_NOTHROW -{ - return static_cast(float(*this)); -} - inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW { qfloat16 f; -- cgit v1.2.3