summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKimmo Ollila <kimmo.ollila@qt.io>2017-03-26 17:38:16 +0300
committerKimmo Ollila <kimmo.ollila@qt.io>2017-03-27 09:00:15 +0000
commit15fe60cfdada84ea519f08e905d59cc3fb6d20cd (patch)
treed206e40d5332ecc66404324e926aa32798ef6062 /src
parente8d03c5599e468937b0e4270309a3be3d710df8f (diff)
Workaround GHS compiler bug
This temporary workaround allows to compile with GHS toolchain and should be removed when GHS provides patch to fix the compiler issue. Change-Id: I0d0eac8054e6ba2f448fed3d3c80a518e0d2af97 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 1d81d1fcb5..68be82c71d 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -534,7 +534,19 @@ QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineE
#endif
}
// If there is a 'before' action, it takes preference
+
+ // There's a bug in GHS compiler that causes internal error on the following code.
+ // The affected GHS compiler versions are 2016.5.4 and 2017.1
+ // This temporary workaround allows to compile with GHS toolchain and should be
+ // removed when GHS provides a patch to fix the compiler issue.
+
+#if defined(Q_CC_GHS)
+ const SideWidgetLocation loc = {position, -1};
+ const auto location = before ? findSideWidget(before) : loc;
+#else
const auto location = before ? findSideWidget(before) : SideWidgetLocation{position, -1};
+#endif
+
SideWidgetEntryList &list = location.position == QLineEdit::TrailingPosition ? trailingSideWidgets : leadingSideWidgets;
list.insert(location.isValid() ? list.begin() + location.index : list.end(),
SideWidgetEntry(w, newAction, flags));