Details
-
Epic
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
C++20 <version> @ Qt
-
5
-
Foundation Sprint 69, Foundation Sprint 70
-
83bf81fd7 (6.4), 4771dc308 (dev), 2a5d850e4 (6.9), f36cf92db (6.8), f1cf87ed3 (tqtc/lts-6.5)
Description
C++20 finally incorporated SD-6 feature test macros
- __cpp_xxx language macros (pre-defined)
- __cpp_lib_xxx library macros (#define'd in <version>
That means Microsoft now needs to implement them, finally.
We've been requiring them in the SD-6 form for all post-C++11 features (conscious policy decision to leave MSVC users out). No problem for language macros, as they're all pre-defined. Problem are the library macros:
- __cpp_lib_optional only defined in <optional>
- ok, so wrap #include <optional> in #if __has_include(<optional>)
- but: <optional> #error's when #include'd in C++14 builds
This particular issue is behind us, and we can hope that compiler vendors have learned the lesson to either not report back true on __has_include for newer-than-requested headers or else no longer #error out, but simply not declare anything.
Nevertheless, the __has_include dance is very annoying, so <version> may end up being the first C++20 feature we require from all compilers.
Availability:
- libc++ ≥ LLVM 7 (what about AppleClang?)
- libstd++ ≥ GCC 9 (what about QNX?)
- MS STL ≥ main@
{2019-09-05}
(what did this ship in?)
- RougeWave (unknown, does anyone still ship that)
- Dinkumware (unknown, does anyone still ship that)
Depending on how far away we are on the various platforms, we may require a <version>, or we write a q20version.h.
Attachments
Issue Links
- is required for
-
QTBUG-99243 Initiative: Qt and C++20
-
- Open
-
-
QTBUG-109360 Use C++20 code with Qt (Phase I)
-
- Open
-