aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@qt.io>2022-05-02 10:33:27 +1000
committerMarc Mutz <marc.mutz@qt.io>2022-05-03 23:32:05 +0000
commit156337ce3c9e33b5f8421113bd36d7685ad92350 (patch)
tree1836b432309af663840381916f292244fec34fe8
parent9b64eee22d9e2d40d1283e8844cb1d8899232547 (diff)
Work around GCC 8 limitation in constexpr functions
Q_UNREACHABLE is not constexpr on Debug builds, as it calls qt_assert_x(). That should not be a problem, as there are plenty of parameter values that make the function's body a generalized constant expression, yet GCC 8 complains about a call to a non- constexpr function. Fixed in GCC 9. Pick-to: 6.3 Change-Id: Ie48b278f5ec154b283809edda44fabe5ed413c27 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r--src/quick/items/qquickpalette.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickpalette.cpp b/src/quick/items/qquickpalette.cpp
index d81fcf7e85..600fe2ec26 100644
--- a/src/quick/items/qquickpalette.cpp
+++ b/src/quick/items/qquickpalette.cpp
@@ -56,7 +56,13 @@ static constexpr bool is_valid(QPalette::ColorGroup cg) noexcept
case QPalette::All:
return false;
}
+
+ // GCC 8.x does not tread __builtin_unreachable() as constexpr
+#if defined(Q_CC_INTEL) || defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && Q_CC_GNU >= 900)
Q_UNREACHABLE();
+#endif
+
+ return false;
}
/*!