QProperty: only use MSVC bug workaround on MSVC
The fix for QTBUG-106277 appears to cause issues with older gcc versions in C++2a mode (for instance used in our headers check). Thus, use the old code for all non-MSVC compilers, which never had problems with it. Pick-to: 6.4 6.2 Fixes: QTBUG-108039 Change-Id: If6a0ce6e8f41e9dc752614557e96c555ca0fe75c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>bb10
parent
c4cb464d74
commit
62a2951795
|
|
@ -18,7 +18,16 @@
|
|||
#if defined(__cpp_lib_source_location)
|
||||
#define QT_SOURCE_LOCATION_NAMESPACE std
|
||||
#define QT_PROPERTY_COLLECT_BINDING_LOCATION
|
||||
#define QT_PROPERTY_DEFAULT_BINDING_LOCATION QPropertyBindingSourceLocation::fromStdSourceLocation(std::source_location::current())
|
||||
#if defined(Q_CC_MSVC)
|
||||
/* MSVC runs into an issue with constexpr with source location (error C7595)
|
||||
so use the factory function as a workaround */
|
||||
# define QT_PROPERTY_DEFAULT_BINDING_LOCATION QPropertyBindingSourceLocation::fromStdSourceLocation(std::source_location::current())
|
||||
#else
|
||||
/* some versions of gcc in turn run into
|
||||
expression ‘std::source_location::current()’ is not a constant expression
|
||||
so don't use the workaround there */
|
||||
# define QT_PROPERTY_DEFAULT_BINDING_LOCATION QPropertyBindingSourceLocation(std::source_location::current())
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue