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

lupdate breaks class resolution when any #include directive is not followed by space

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.2
    • 4.8.5
    • Tools: Linguist
    • None
    • 0eb10e4193e1cfcc887359f194d48b52d5840bbe

    Description

      When an #include directive is found in a .cpp file which is not immediately followed by space, it looks that the namespace/class resolution is broken.

      C.h
      class C : public QObject
      {
          Q_OBJECT
      };
      

      Notice the missing space in the fist include below:

      C.cpp
      #include<sstream>
      #include "C.h"
      
      bool C::aaa()
      {
          // works OK
          ::C::tr("..");
          // does not work
          tr("..");
      }
      
      $ lupdate -silent C.cpp -ts foo.ts
      [...]C.cpp:9: Qualifying with unknown namespace/class ::C
      

      Please note that the actual header file which defines the C class does not contain the "missing space error". Also note that neither gcc 4.6 nor clang 3.3 complains about the missing space.

      Attachments

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

        Activity

          People

            markan Marko Kangas
            jkt Jan Kundrát
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes