Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42744 lupdate needs C++11 support
  3. QTBUG-34128

lupdate ignores tr() calls in constructor if a member is initialized with C++11 initializer list

    XMLWordPrintable

Details

    • Technical task
    • Resolution: Done
    • P2: Important
    • 5.6.1
    • Tools: Linguist
    • None
    • 4ea581c95ae9704b250591c5d4d9b0517f5b62f2

    Description

      If I initialize a member of a class using a C++11 initializer list like this:

      Foo:Foo(): m_foo{1, 2, 3}
      {
       tr("foo");
      }
      

      then the tr() call in the constructor is not found, instead lupdate gives the error message "tr() cannot be called without context". It doesn't matter if I add () around {}. If I initialize the member using any other method the tr() call will be found and extracted.

      Attachments

        1. init11.cpp
          0.3 kB
          Rolf Eike Beer

        Activity

          People

            dg0yt Kai Pastor
            rebemlix Rolf Eike Beer
            Votes:
            9 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: