Redo the Q_FOREACH loop control without GCC statement expressions
authorThiago Macieira <thiago.macieira@intel.com>
Wed, 12 Feb 2014 00:17:46 +0000 (16:17 -0800)
committerFelix Geyer <fgeyer@debian.org>
Sun, 14 Jul 2019 10:19:27 +0000 (11:19 +0100)
commitf2a5a7dbfde91ab648baca0124fde135fc0d49bc
tree9c31dee6d23261924dea7f7518d9e15ec9dcba50
parentee4152459f6139879c33a0ffeca0a476adbf894b
Redo the Q_FOREACH loop control without GCC statement expressions

It's possible to do without them, which probably makes the number of
supported compilers a lot bigger: they just need to support decltype()
or __typeof__.

That includes the Intel compiler. The old code was also apparently
working, but no one had realized the old workaround for some old version
was still in place.

The loop overhead is more or less the same. I have not done benchmarks,
but inspection of the generated assembly shows more or less the same
number of instructions.

Change-Id: I32d499c84a6ddd19d994b49f17a469acb5c3a3f1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Backported to Qt 4

Gbp-Pq: Name gcc9-qforeach.patch
src/corelib/global/qglobal.h