Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.8.4, 5.0.0
-
None
-
0c4f6c6ea9415bcc5fde3e34bf909f43a9c6483c 58355a22d424ae079dea9899bb127426724ca370
Description
The qtconcurrentrun.h wants to optimize when stdc++11 features
are available but the ifdef is only guarded by Q_COMPILER_DECLTYPE.
That Q_COMPILER_DECLTYPE is defined in qglobals.h if gcc >= 4.3
but the qtconcurrentrun.h source text does also use the new
function decleration syntax ("foo() -> result") which is only
available if gcc >= 4.4.
Therefore, enabling stdc++11 support on gcc-4.3 will make any
Qt program to fail immediately. Tested on current SLES 11 SP2.
> make good
{ echo "#include <QtCore>" ; echo "int main() {}"; } > good.cpp
/usr/bin/gcc-4.3 -I/usr/include/Qt good.cpp -c -o good.o
> make fail
{ echo "#include <QtCore>" ; echo "int main() {}"; } > fail.cpp
/usr/bin/gcc-4.3 -I/usr/include/Qt -std=gnu++0x fail.cpp -c -o fail.o
In file included from /usr/include/Qt/QtCore:62,
from fail.cpp:1:
/usr/include/Qt/qtconcurrentrun.h:105: error: expected initializer before ‘->’ token
/usr/include/Qt/qtconcurrentrun.h:113: error: expected initializer before ‘->’ token
/usr/include/Qt/qtconcurrentrun.h:121: error: expected initializer before ‘->’ token
/usr/include/Qt/qtconcurrentrun.h:129: error: expected initializer before ‘->’ token
/usr/include/Qt/qtconcurrentrun.h:137: error: expected initializer before ‘->’ token
/usr/include/Qt/qtconcurrentrun.h:145: error: expected initializer before ‘->’ token
make: *** [fail] Fehler 1
> cat /etc/issue
Welcome to SUSE Linux Enterprise Server 11 SP2 (x86_64) - Kernel \r (\l).
> rpm -q --whatprovides /usr/include/Qt/qtconcurrentrun.h
libqt4-devel-4.8.4-284.1
> rpm -q --whatprovides /usr/bin/gcc
gcc-4.3-62.198
Attachments
For Gerrit Dashboard: QTBUG-28984 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
44138,1 | Fix compilation of Qt Concurrent with gcc 4.3 | stable | qt/qtbase | Status: MERGED | +2 | 0 |
44139,3 | Define Q_COMPILER_AUTO_FUNCTION in Qt 4.8. | 4.8 | qt/qt | Status: MERGED | +2 | 0 |
44140,2 | Fix compilation of Qt Concurrent with gcc 4.3 | 4.8 | qt/qt | Status: MERGED | +2 | 0 |