Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Parse code by clang with the error about Q_COMPILER_UNICODE_STRINGS

Parse code by clang with the error about Q_COMPILER_UNICODE_STRINGS

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 544 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ejok88
    wrote on last edited by
    #1

    Hello, I try to parse a simple code by clang (llvm 7.0.0).
    It must include <QObject> to properly parse Q_OBJECT macro and so on. When I did, I got errors:

    
    C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypetraits.h:251:19: error: redefinition of 'is_integral<unsigned short>'
    C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypetraits.h:252:19: error: redefinition of 'is_integral<unsigned int>'
    C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypeinfo.h:325:1: error: redefinition of 'QTypeInfo<unsigned short>'
    C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qtypeinfo.h:326:1: error: redefinition of 'QTypeInfo<unsigned int>'
    C:\Qt\Qt5.7.0\5.7\mingw53_32\include\QtCore/qflags.h:49:10: fatal error: 'initializer_list' file not found
    

    There is a problem:

    template<> struct is_integral<unsigned short> : true_type { };
    template<> struct is_integral<unsigned int> : true_type { };
    ...
    #if defined (Q_COMPILER_UNICODE_STRINGS)
    template<> struct is_integral<char16_t> : true_type { };
    template<> struct is_integral<char32_t> : true_type { };
    #endif
    

    It works without clang, but clang initiate the using of Q_COMPILER_UNICODE_STRINGS. That fact breaks the code.. Is there a bug (there is no if/else branch in the code for this case)?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      I don't think anybody tests Qt with clang on Windows, so it is likely a bug. Feel free to check / report on Qt bug tracker bugreports.qt.io

      (Z(:^

      aha_1980A 1 Reply Last reply
      4
      • sierdzioS sierdzio

        I don't think anybody tests Qt with clang on Windows, so it is likely a bug. Feel free to check / report on Qt bug tracker bugreports.qt.io

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @sierdzio ... but before it would be useful to upgrade to Qt 5.12.x

        Qt has to stay free or it will die.

        sierdzioS 1 Reply Last reply
        3
        • aha_1980A aha_1980

          @sierdzio ... but before it would be useful to upgrade to Qt 5.12.x

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @aha_1980 said in Parse code by clang with the error about Q_COMPILER_UNICODE_STRINGS:

          @sierdzio ... but before it would be useful to upgrade to Qt 5.12.x

          haha, right, I missed that bit :-)

          (Z(:^

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved