QList: give the LWG 3346 #ifdef'ery a symbolic name

We'll need this in more places, so centralize its definition in
qcompilerdetection.h.

Amends 595b4e1a9b436a8190964dc41f79621400f5a6be.

Change-Id: I87f84cb9ff3ad339c000604423295180176f5799
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f4cfc21dec6319c2ae99042be6bb12922a9d336d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bfd565a4d300b4227b09fa1e52c18778d997d96c)
(cherry picked from commit 0c8e26bbfc5cf58854124ca1f9082aa4c1dbc065)
This commit is contained in:
Marc Mutz 2024-02-08 11:36:57 +01:00
parent 8a5a0e1b91
commit ac21796c2f
3 changed files with 8 additions and 5 deletions

View File

@ -1370,6 +1370,11 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
# endif
#endif
// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
# define QT_COMPILER_HAS_LWG3346
#endif
#endif // __cplusplus
#endif // QCOMPILERDETECTION_H

View File

@ -109,8 +109,7 @@ public:
public:
using difference_type = qsizetype;
using value_type = T;
// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
#ifdef QT_COMPILER_HAS_LWG3346
using iterator_concept = std::contiguous_iterator_tag;
using element_type = value_type;
#endif
@ -180,8 +179,7 @@ public:
public:
using difference_type = qsizetype;
using value_type = T;
// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
#ifdef QT_COMPILER_HAS_LWG3346
using iterator_concept = std::contiguous_iterator_tag;
using element_type = const value_type;
#endif

View File

@ -9,7 +9,7 @@
#include <qlist.h>
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
#ifdef QT_COMPILER_HAS_LWG3346
# if __has_include(<concepts>)
# include <concepts>
# if defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L