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

Qt 6 dev, C++20, clang, libstdc++-11 : does not build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.2
    • Core: Other
    • None
    • All

    Description

      Hello,

      when trying to use current Qt dev with clang, on Linux, with -std=c++20, and gcc-11's standard library, I get the following :

      In file included from /opt/qt6/include/QtCore/qobject.h:57:
      /opt/qt6/include/QtCore/qproperty.h:105:72: error: no type named 'source_location' in namespace 'std'
       QPropertyBindingSourceLocation(const QT_SOURCE_LOCATION_NAMESPACE::source_location &cppLocation)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      /opt/qt6/include/QtCore/qproperty.h:200:92: error: no member named 'source_location' in namespace 'std'
       auto makePropertyBinding(Functor &&f, const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

      It seems that clang provides the source_location header, but without the content :

      #include <source_location>
      std::source_location x;
      

      builds fine with

      g++ -std=c++20 -c foo.cpp

      but not with

      clang++ -std=c++20 -c foo.cpp

      (which uses libstdc++ by default)

      Both seem to support the __cpp_lib_source_location feature test macro, if that can be of any use.

      Attachments

        Issue Links

          Activity

            People

              thiago Thiago Macieira
              jcelerier Jean-Michaƫl Celerier
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: