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

Apple Clang version detected incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.4.0
    • Core: Other
    • None
    • d47b9ace50d47a4472dc9fb029bbf6e8dd810c01

    Description

      When compiling with Xcode 4.6 and Qt 5.4.0, I get compile errors that did not occur in 5.3.1:

      SDKs/Qt/5.4.0/mac/clang/frameworks/include/QtWidgets/qapplication.h:37:
      In file included from SDKs/Qt/5.4.0/mac/clang/frameworks/include/QtCore/qcoreapplication.h:40:
      In file included from SDKs/Qt/5.4.0/mac/clang/frameworks/include/QtCore/qobject.h:48:
      SDKs/Qt/5.4.0/mac/clang/frameworks/include/QtCore/qmetatype.h:1943:1: error: copying variable of type 'QBasicAtomicInt' (aka 'QBasicAtomicInteger<int>') invokes deleted constructor
      Q_DECLARE_METATYPE_TEMPLATE_2ARG(QPair)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      SDKs/Qt/5.4.0/mac/clang/frameworks/include/QtCore/qmetatype.h:1808:32: note: expanded from macro 'Q_DECLARE_METATYPE_TEMPLATE_2ARG'
      static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      SDKs/Qt/5.4.0/mac/clang/frameworks/include/QtCore/qmetatype.h:1509:82: note: in instantiation of member function 'QMetaTypeId<QPair<QVariant, QVariant> >::qt_metatype_id' requested here
      static inline Q_DECL_CONSTEXPR int qt_metatype_id() { return QMetaTypeId<T>::qt_metatype_id(); }
      ^
      SDKs/Qt/5.4.0/mac/clang/frameworks/include/QtCore/qbasicatomic.h:229:5: note: function has been explicitly marked deleted here
      QBasicAtomicInteger(const QBasicAtomicInteger &) = delete;
      ^
      1 error generated.
      

      I believe this is caused by https://qt.gitorious.org/qt/qtbase/commit/85a71381145528d446416d2744734384dbe739b4

      That change uses Apple build numbers like "600051" and "425024" but the actual build numbers are one digit longer, so all Xcode versions evaluate to Q_CC_CLANG = 305, incorrectly.

      For example:

      $ /Applications/Xcode-4.6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -dM -E - < /dev/null | grep __apple_build_version__
      #define __apple_build_version__ 4250028
      

      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
              chrisdolan Chris Dolan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes