647c0e80ed
Client code on MSVC *must* pass /Zc:__cplusplus when using Qt. Otherwise, this makes Qt code that relies on feature-testing macros a mess. For instance, in QTBUG-91117, we trip on this code: // C++ version guard is necessary: you may have the header, // but including it in pre-C++20 will cause an hard error #if __has_include(<bit>) && __cplusplus > 201703L #include <bit> #endif #if defined(__cpp_lib_bitops) // use some <bit> functionality #endif The #define __cpp_lib_bitops should've come from the preceding include directive, but there's another possibility: that it comes from <version> (or some other similar header) included transitively, when compiling in C++20 mode, and *without* a bumped __cplusplus. Yes, that's an actual possibility on MSVC. Then, since we did not include <bit> ourselves due to the __cplusplus version check, using the functionality will cause a compile error. We're not going to fix *every* post C++-17 feature detection macro because of MSVC and feature-test shenanigans. It's time to require compilers to tell us the truth about what they support. Fixes: QTBUG-91117 Change-Id: I9d74f9d8b74b5ac35dce3528e7a2006746a00676 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io> |
||
---|---|---|
.. | ||
3rdparty | ||
android | ||
concurrent | ||
corelib | ||
dbus | ||
entrypoint | ||
gui | ||
network | ||
opengl | ||
openglwidgets | ||
platformsupport | ||
plugins | ||
printsupport | ||
sql | ||
testlib | ||
tools | ||
widgets | ||
xml | ||
CMakeLists.txt |