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

compiler detection fails with g++ on mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0 RC1, 5.3.0
    • 5.2.0 RC1
    • Core: Other
    • None
    • OsX 10.8.5 Xcode 5.1
    • macOS
    • 387f75c39bfad4439a6bd013089c2cd216cda5ea

    Description

      qcompilerdetection.h

      573 # if _cplusplus >= 201103L || defined(GXX_EXPERIMENTAL_CXX0X_)
      ..
      617 # if __has_feature(cxx_generalized_initializers)

      returns true because the compiler could support that feature when called with -std=c++0x (which qmake does), but the library does not (no header).
      Please note that we have

      #define _GXX_EXPERIMENTAL_CXX0X_ 1
      #define __cplusplus 201103L
      #define __cpp_attributes 200809
      #define __cpp_constexpr 200704
      #define __cpp_decltype 200707
      #define __cpp_lambdas 200907
      #define __cpp_raw_strings 200710
      #define __cpp_rvalue_references 200610
      #define __cpp_static_assert 200410
      #define __cpp_unicode_characters 200704
      #define __cpp_unicode_literals 200710
      #define __cpp_user_defined_literals 200809
      #define __cpp_variadic_templates 200704

      We could detect this using (for example)

      #define _GLIBCXX_ 20070719
      #define _GNUC_GNU_INLINE_ 1
      #define _GNUC_LIBSTD_MINOR_ 2
      #define _GNUC_LIBSTD_ 4
      #define _GNUC_MINOR_ 2
      #define _GNUC_PATCHLEVEL_ 1

      but the same happens probably is true for Q_COMPILER_RVALUE_REFS and probably other features, so I wonder if we should not disable basically all the __feature detection

      The other question is also how much we want to support compiling with g+, for 5.3 it is still feasible (as we link libstdc+ in our packages), but 5.4 should link libc++ I think (and c++11).

      Attachments

        For Gerrit Dashboard: QTBUG-38193
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            fawzi Fawzi Mohamed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes