diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 9c002f378ff..b25e9325954 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -49,15 +49,23 @@ #if __has_include() && __cplusplus >= 202002L && !defined(Q_CLANG_QDOC) #include +#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(std::source_location::current()) -#elif __has_include() && __cplusplus >= 201703L && !defined(Q_CLANG_QDOC) +#endif +#endif + +#if !defined(QT_PROPERTY_COLLECT_BINDING_LOCATION) && __has_include() && __cplusplus >= 201703L && !defined(Q_CLANG_QDOC) #include +#if defined(__cpp_lib_experimental_source_location) #define QT_SOURCE_LOCATION_NAMESPACE std::experimental #define QT_PROPERTY_COLLECT_BINDING_LOCATION #define QT_PROPERTY_DEFAULT_BINDING_LOCATION QPropertyBindingSourceLocation(std::experimental::source_location::current()) -#else +#endif +#endif + +#if !defined(QT_PROPERTY_COLLECT_BINDING_LOCATION) #define QT_PROPERTY_DEFAULT_BINDING_LOCATION QPropertyBindingSourceLocation() #endif