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

when I include header: <QtCore> or <QtGui> that include qendian.h, and build will error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 5.12.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      system: CentOS 7
      QT: Qt 5.12
    • Platform/s:
      Linux/X11

      Description

      when I include QtCore or QtGui header that include qendian.h, and build my project that will get errors:
      /opt/Qt/5.12.0/gcc_64/include/QtCore/qendian.h:165:61: error: redeclaration 'constexpr T qbswap(T) [with T = qfloat16]' differs in 'constexpr'
      template <> inline qfloat16 qbswap<qfloat16>(qfloat16 source)
      ^
      /opt/Qt/5.12.0/gcc_64/include/QtCore/qendian.h:96:42: error: from previous declaration 'constexpr T qbswap(T) [with T = qfloat16]'
      template <typename T> Q_DECL_CONSTEXPR T qbswap(T source);
      ^
      /opt/Qt/5.12.0/gcc_64/include/QtCore/qendian.h:170:52: error: redeclaration 'constexpr T qbswap(T) [with T = float]' differs in 'constexpr'
      template <> inline float qbswap<float>(float source)
      ^
      /opt/Qt/5.12.0/gcc_64/include/QtCore/qendian.h:96:42: error: from previous declaration 'constexpr T qbswap(T) [with T = float]'
      template <typename T> Q_DECL_CONSTEXPR T qbswap(T source);
      ^
      /opt/Qt/5.12.0/gcc_64/include/QtCore/qendian.h:175:55: error: redeclaration 'constexpr T qbswap(T) [with T = double]' differs in 'constexpr'
      template <> inline double qbswap<double>(double source)
      ^
      /opt/Qt/5.12.0/gcc_64/include/QtCore/qendian.h:96:42: error: from previous declaration 'constexpr T qbswap(T) [with T = double]'
      template <typename T> Q_DECL_CONSTEXPR T qbswap(T source);

        Attachments

        1. 2.png
          2.png
          80 kB
        2. 1.png
          1.png
          94 kB

          Issue Links

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

            Activity

              People

              Assignee:
              thiago Thiago Macieira
              Reporter:
              alexmercer 豪杰 张
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes