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

Q_ENUM cannot contain LLONG_MAX

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.6.1
    • Core: Object Model
    • None
    • Linux/Wayland

    Description

      I have prepared minimal test case at https://github.com/jmlich/testEnum/

      It seems to be regression, because it compiles with Qt 6.5.3, but not with Qt 6.6.1 (compiled with gcc 13.2.1 in both cases)

      The LLONG_MAX in combination with Q_ENUM generates some code which cannot be compiled:

          enum Constants {
              InvalidValue64 = LLONG_MAX
          };  

      Removal of LLONG_MAX at https://github.com/jmlich/testEnum/blob/main/testclass.h#L16 or removal of Q_ENUM macro workarounds the issue.

      I was trying to find out specification and it seems enum should be able to store long long int.

      Code originally comes from https://github.com/sailfishos/libqofonoext/blob/1bc9c91172c998e06547f862ddaeef18e8b435d6/src/qofonoextcell.h#L71

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              xmlich02 Jozef Mlich
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes