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

Projects fail to compile through Clang on Windows via MSVC 16.10

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.1.0
    • Active Qt
    • None
    • Microsoft Visual Studio Community 2019
      Version 16.10.0

    Description

      Upon upgrading to Microsoft Visual Studio Community 2019 Version 16.10.0, I found that none of my Qt projects compile with the Clang version provided through Visual Studio. Initially, I thought this was related to https://bugreports.qt.io/browse/QTBUG-93270, but that turned out to be only half of the battle:

      The qproperty.h header file assumes that just because the header file <source_location> is present, means that the compiler supports the underlying mechanism for it (consteval), which Clang does not support on any version that I'm aware of. This is a reasonable assumption since under normal circumstances compile-time checks would fail when trying to include <source_location> on compilers that don't support consteval, however no errors are thrown by Microsoft's standard library implementation, only informational messages are emitted:

      #ifndef __cpp_consteval
      #pragma message("The contents of <source_location> are available only with C++20 consteval support.")

      I'll be submitting a bug report about this, too.

      And even if <source_location> isn't viable (and <experimental/source_location> is gone as well), it seems qproperty.h can handle those cases.

      This issue can be resolved by changing line 52:

      #if __has_include(<source_location>) && __cplusplus >= 202002L && !defined(Q_CLANG_QDOC)
      

      to:

      #if __has_include(<source_location>) && __cplusplus >= 202002L && !defined(Q_CLANG_QDOC) && defined(__cpp_consteval)
      

      in qproperty.h. I would've submitted a patch, but I'm unable to at this time.

       

      Attachments

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

        Activity

          People

            laknoll Lars Knoll
            averetzi Michael Rodriguez
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes