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

lupdate cannot correctly parse ' (spliter) in numbers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.10.0, 5.11.1
    • Tools: Linguist
    • None
    • All

      C++ standard allows using ' as a spliter when writing hex numbers for better readability, such as:

      unsigned long long x = 0x00000000'00000000;
      

      This, however, does not work well with Qt Linguist tools lupdate. Not only it will warn "Unterminated C++ character", but also can it affect later tr() parsing IN CERTAIN CASES.

      Attached is a minimal test to reproduce this issue.

      Steps to reproduce:

      • Unzip it
      • Run
        lupdate QtBugTest.pro -ts en.ts
      • EXPECTED:
        Updating 'en.ts'...
            Found 1 source text(s) (1 new and 0 already existing)
      • ACTUAL:
        xxx/mainwindow.cpp:6: Unterminated C++ character
        xxx/mainwindow.cpp:7: Unterminated C++ character
        xxx/mainwindow.cpp:8: Unterminated C++ character
        xxx/mainwindow.cpp:11: Excess closing brace in C++ code (or abuse of the C++ preprocessor)
        xxx/mainwindow.cpp:16: tr() cannot be called without context
        xxx/mainwindow.cpp:7: Unbalanced opening parenthesis in C++ code (or abuse of the C++ preprocessor)
        Updating 'en.ts'...
            Found 0 source text(s) (0 new and 0 already existing)

      I had the issue on my Qt 5.10.0 MSVC AND Qt 5.11.1 MinGW.

      Thank you!

        1. QtBugTest.zip
          4 kB
          Zhu Peng Fei
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            buddenha Oswald Buddenhagen
            zhupengfei Zhu Peng Fei
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes