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

Found a way to destabilize MOC

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.14.0, 5.14.1
    • Fix Version/s: None
    • Component/s: Build tools: moc
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      Namespace + special way of defining enum’s

      The main part of the code:

      namespace svr {
      
          enum class X {   // ..\CrashMoc\FmMain.h:8: Parse error at "{"
              #define SL(x) x,
              #include "enum_X.h"
          };
      
      }
      
      // enum_X.h
      #ifndef SL
          #error You should define SL(x) macro right beforehand!
          #define SL(x)   // to gag an error in IDE
      #endif
      
          SL(ALPHA)
          SL(BRAVO)
      
      #undef SL
      

      Worked in 5.13.

      Why? Because enum members aren’t just members, we tie some properties to them, and to make members in sync with arrays, we use that header.

        Attachments

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

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Mercury13kiev Mikhail Merkuryev
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes