From 77c0c1ca6505eb66bd75b3766f9a498574822bd1 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sun, 15 Mar 2015 13:52:55 +0100 Subject: Fix C++14 compilation in QRgba64 QRgba64 has Q_DECL_RELAXED_CONSTEXPR that builds a QRgba64, but it has no constructor that can be used in a constexpr. Change-Id: Ia032b65151243d071440c05479e8f2549c8b9503 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qrgba64.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/gui/painting/qrgba64.h') diff --git a/src/gui/painting/qrgba64.h b/src/gui/painting/qrgba64.h index e3a5bc3754..2ea09e6bd6 100644 --- a/src/gui/painting/qrgba64.h +++ b/src/gui/painting/qrgba64.h @@ -54,7 +54,12 @@ public: // When c++11 is mandatory, we can add all but a copy constructor. Q_DECL_RELAXED_CONSTEXPR static QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha) { - QRgba64 rgba64; + QRgba64 rgba64 +#ifdef Q_COMPILER_UNIFORM_INIT + = {} +#endif + ; + rgba64.c.red = red; rgba64.c.green = green; rgba64.c.blue = blue; @@ -63,7 +68,11 @@ public: } Q_DECL_RELAXED_CONSTEXPR static QRgba64 fromRgba64(quint64 c) { - QRgba64 rgba64; + QRgba64 rgba64 +#ifdef Q_COMPILER_UNIFORM_INIT + = {} +#endif + ; rgba64.rgba = c; return rgba64; } -- cgit v1.2.3