Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
4.7.0
-
None
Description
Tested with Qt 4.7.0.
Source code with consecutive string literals with no whitespace between them break the moc parsing. For example,
"hello"" world"
(which is permitted by the compiler and is the same as "hello world").
Full steps to reproduce:
- Firstly, the "control": create a file named frobnitzquuxer.cpp with the following content:
#include <QObject> #include <stdio.h> class FrobnitzQuuxer : public QObject { Q_OBJECT }; int main(int, char**) { printf("Hello world\n"); } #include "frobnitzquuxer.moc"
- Run qmake -project && qmake && make && make clean
- Observe that it built fine
- Now, to demonstrate the breakage: modify the file to the following content: (the only difference is in the `printf' line)
#include <QObject> #include <stdio.h> class FrobnitzQuuxer : public QObject { Q_OBJECT }; int main(int, char**) { printf("Hello ""world\n"); } #include "frobnitzquuxer.moc"
- Run qmake -project && qmake && make
- Observe that compilation breaks: frobnitzquuxer.cpp:12:30: error: frobnitzquuxer.moc: No such file or directory
Attachments
Issue Links
- duplicates
-
QTBUG-17533 string literal concatenation causes qmake to fail to detect dependencies
-
- Closed
-
For Gerrit Dashboard: QTBUG-19393 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
143496,2 | Revert "tests: fixed compilation of tst_qtextstream" | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |