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

Classes with attributes confuse lupdate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.2
    • Tools: Linguist
    • None
    • macOS

      Classes with C++11 style attributes confuse lupdate. A minimal sample is:

      #include <QObject>
      
      class [[maybe_unused]] Test : public Q_OBJECT {
        Q_OBJECT
      
      public:
        Test();
      };
      
      Test::Test() {
        setObjectName(tr("Test"));
      }
      

      Running lupdate on this reports the following error:

      $ ~/Qt/6.9.2/macos/bin/lupdate test.cpp
      lupdate warning: no TS files specified. Only diagnostics will be produced.
      test.cpp:11: Qualifying with unknown namespace/class ::Test

      Removing the attribute fixes the issue.

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

            kkohne Kai Köhne
            jasonhaslam Jason Haslam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes