qt5base-lts/src
Giuseppe D'Angelo 647c0e80ed Enforce __cplusplus >= 201703L on MSVC
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>
2021-03-22 19:57:07 +00:00
..
3rdparty SQLite: Update to 3.35.2 2021-03-20 11:41:24 +01:00
android Android: Fix constant resize of a large TextEdit on click 2021-03-10 13:11:33 +01:00
concurrent Remove the unnecessary template parameter from the class specialization 2021-03-17 16:38:36 +01:00
corelib Enforce __cplusplus >= 201703L on MSVC 2021-03-22 19:57:07 +00:00
dbus Doc: Change section titles that cause bad links 2021-03-11 15:01:35 +01:00
entrypoint Fix qmake user projects for QT_LIBINFIX builds on Windows/iOS 2021-03-17 09:04:56 +01:00
gui Fix alpha handling of QImage::setPixel 2021-03-22 14:29:14 +01:00
network Suppress warning (MSVC, C4250) 2021-03-19 17:32:59 +01:00
opengl Doc: Change section titles that cause bad links 2021-03-11 15:01:35 +01:00
openglwidgets Document QOpenGLWidget limitations without an alpha channel 2021-01-15 15:21:28 +01:00
platformsupport evdevtouch: Fix wrong addTouchPoint for "mtdev" 2021-02-23 14:22:20 +00:00
plugins QSql/MariaDB/MySQL: use utf-8 as encoding for username and password 2021-03-19 09:11:38 +00:00
printsupport Add nullptr check 2021-03-16 18:44:17 +01:00
sql QSqlQuery: make it a move only type 2021-03-21 10:16:56 +01:00
testlib Doc: Change section titles that cause bad links 2021-03-11 15:01:35 +01:00
tools qtpaths: Fix cross compilation for windows 2021-03-15 10:30:18 +02:00
widgets Fix invalid pointer return with QGridLayout::itemAt(-1) 2021-03-22 18:47:36 +08:00
xml The condition 'if(oldChild)' is redundant 2021-03-03 20:52:45 +08:00
CMakeLists.txt Make it possible to disable the PrintSupport module 2021-02-09 09:17:21 +01:00