From b5ed3cb7baeb6d77c375134719ee04ffcc211b9f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Apr 2022 10:16:17 +0200 Subject: qmake: Add support for C++23 Add the CONFIG value c++2b that represent the upcoming C++23 standard. Add QMAKE_CXXFLAGS_CXX2B and QMAKE_CXXFLAGS_GNUCXX2B. On MSVC, use /std:c++latest when c++2b is active. This fixes an issue with MSVC where c++latest implied the /std:c++20 compiler flag. Pick-to: 5.15 6.2 6.3 Fixes: QTBUG-102202 Change-Id: Ie00ee5793c1a649195013c8c19efc8d59cf0acc9 Reviewed-by: Alexandru Croitor Reviewed-by: Kai Koehne --- mkspecs/features/default_post.prf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mkspecs/features/default_post.prf') diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index b94aab3e9c..2be446e41e 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -123,17 +123,18 @@ breakpad { c++17: CONFIG += c++1z c++20: CONFIG += c++2a -c++latest: CONFIG *= c++2a c++1z c++14 c++11 +c++latest: CONFIG *= c++2b c++2a c++1z c++14 c++11 -!c++1z:!c++2a { +!c++1z:!c++2a:!c++2b { # Qt requires C++17 QT_COMPILER_STDCXX_no_L = $$replace(QT_COMPILER_STDCXX, "L$", "") !greaterThan(QT_COMPILER_STDCXX_no_L, 201402): CONFIG += c++1z } -c++1z|c++2a { +c++1z|c++2a|c++2b { # Disable special compiler flags for host builds !host_build|!cross_compile { - c++2a: cxxstd = CXX2A + c++2b: cxxstd = CXX2B + else:c++2a: cxxstd = CXX2A else: cxxstd = CXX1Z } else { # Fall back to c++17, because C++17 is required everywhere, -- cgit v1.2.3