Go to file
Giuseppe D'Angelo 0dc6cc0551 MSVC: enforce that we are under /permissive-
MSVC defaults to a C++ dialect which is not standard-compliant. For
a number of years, it has offered a switch (/permissive-) to enable
standards conformance, but it was entirely opt-in. While we do build
(and test) Qt under /permissive-, our users do not necessarily do
that for their own software.

Meaning, we risk subtle bugs and build issues for the code present
in our headers (because users may use them in non-/permissive- mode).
This has already happened multiple times (QTBUG-95880, as well as
19b5520abf).

So far, we couldn't *enforce* /permissive- for client code, as MSVC
didn't deem it stable, and various SDKs (like Windows') were not even
building under it.

This has now changed. /permissive- is now deemed fully stable and
supported, and turned on by default when using /std:c++20 (since VS 2019
16.11 [1]). So, starting from 6.3, we can now pretend its presence.

Unfortunately /permissive- does not set any special macros for us to
test [2], so test one of its side-effects: that an implicit conversion
from std::nullptr_t to bool is ill-formed (the conversion is explicit).

[1] https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/
[2] https://developercommunity.visualstudio.com/t/Pre-define-a-macro-when-compiling-under/1253982?space=62&q=permissive-+sfinae&entry=myfeedback

[ChangeLog][Platform Specific Changes][Windows] When using MSVC
Qt now requires standards compliance mode. This requires passing
the /permissive- command line switch. Note that when using C++20 or
above, the /permissive- switch is implied by default.

Change-Id: I464ed36ff707fa3ada52c543433a6b0ab715748e
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-09-29 18:01:29 +00:00
.github/workflows Github Actions: many minor updates 2021-01-22 18:48:54 +01:00
bin Add missing -help argument to qt-configure-module 2021-08-20 19:44:43 +02:00
cmake CMake: Only write device prefix to target_qt.conf if necessary 2021-09-28 22:18:13 +02:00
coin Revert "coin: Generate JUnit result files" 2021-09-16 17:02:44 +00:00
config.tests Fix separate_debug_info configure test for cross-compilation 2021-09-28 15:59:31 +02:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Doc: Update Microsoft's Documentation Links 2021-09-23 15:55:59 +00:00
examples Remove .qmake.conf from this repository 2021-09-20 19:00:05 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Teach syncqt to filter out QT_DEPRECATED_* macros 2021-09-07 08:28:09 +02:00
mkspecs qmake: Print error when iOS simulator device could not be found 2021-09-22 00:01:30 +02:00
qmake Skip unnecessary commands when cross-building tools 2021-09-27 16:34:23 +02:00
src MSVC: enforce that we are under /permissive- 2021-09-29 18:01:29 +00:00
tests QThread: Reset the system thread ID when thread exits on Unix 2021-09-29 01:53:49 +02:00
util pro2cmake: Generate public CMake API code for projects by default 2021-09-27 21:36:36 +02:00
.cmake.conf Bump version 2021-09-14 13:19:55 +03:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore testlib: Accurately name JUnit test, and only run for JUnitXML reporter 2021-07-29 15:39:40 +02:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt CMake: Enforce minimum CMake version in user projects 2021-08-04 16:03:08 +02:00
conanfile.py Conan: Use recipe revision mode for 'python_requires' 2021-09-23 17:57:04 +03:00
config_help.txt Remove dysfunctional -coverage configure argument 2021-08-10 12:00:13 +02:00
configure Remove unsupported, host-related options from configure shell script 2021-08-05 02:44:27 +02:00
configure.bat Fix our usage of CMake script mode in Windows configure 2021-08-20 19:44:43 +02:00
configure.cmake Add Qt PrintSupport to the configure summary 2021-09-03 21:35:06 +02:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL2 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.GPL3-EXCEPT Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPL3 Add new license header templates and license files 2016-01-14 20:43:46 +00:00
LICENSE.LGPLv3 Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt 2018-04-16 11:02:14 +00:00
LICENSE.QT-LICENSE-AGREEMENT Update enterprise license agreement v4.2.1 2019-12-18 13:07:19 +02:00
qt_cmdline.cmake Remove dysfunctional -coverage configure argument 2021-08-10 12:00:13 +02:00
sync.profile Implement generating of a module cpp export header 2021-06-24 20:40:49 +02:00