diff options
author | Glen Mabey <Glen.Mabey@swri.org> | 2017-05-04 01:33:12 +0000 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2017-05-07 16:44:55 +0000 |
commit | cab9bc8fba8f48be0e469a7097cd4914a4f617d9 (patch) | |
tree | 3f2305c32115e1d361c2d6bc1acdc1d71a187a0d /src | |
parent | fb00b4199e69b91b22d32c5f7e07cc10ed4ec781 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qfloat16.h | 12 |
1 files changed, 0 insertions, 12 deletions
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<double>(float(*this)); -} - -inline qfloat16::operator long double() const Q_DECL_NOTHROW -{ - return static_cast<long double>(float(*this)); -} - inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW { qfloat16 f; |