Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-19393

qmake silently stops parsing .cpp files with consecutive string literals with no whitespace, fails to generate dependencies on .moc

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 4.7.0
    • Build tools: qmake
    • None

      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:

      1. 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"
           
      2. Run qmake -project && qmake && make && make clean
      3. Observe that it built fine
      4. 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"
           
      5. Run qmake -project && qmake && make
      6. Observe that compilation breaks: frobnitzquuxer.cpp:12:30: error: frobnitzquuxer.moc: No such file or directory

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Eddy Edward Welbourne
            rmcgover Rohan McGovern (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes