Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
Qt Creator 2.5.0
-
None
-
23c637c4f677ab2f19793f409297b0131b21dcaa
Description
When a QStringLiteral is found in the source code in C+11 mode (the qmake mkspec has -std=c0x), the C+ parser stops working.
Example:
#include <QString> static inline quint8 fromHex(quint8 c) { c |= 0x20; return c >= 'a' ? c - 'a' + 10 : c - '0'; } static inline QString ftpScheme() { return QStringLiteral("ftp"); } static inline QString httpScheme() { return QStringLiteral("http"); } static inline int foo() { return 1; }
Put the above in a C++ source code, make sure the toolchain is configured for C++11 mode and press Ctrl+K,. (dot). It should list four functions, but it only lists the first two. The problem seems to be the parsing of the expansion of QStringLiteral.
The above code was copied from qurl.cpp from qtbase. You can use that file as an example of this problem. After the first QStringLiteral, the C++ support is simply non-existent. Not only are functions not found, but all expansion provided by Ctrl+Space is gone in 2.5.