libs: clang-19 compile fixes

* clang-19 seems to be stricter at instantiating code, causing compile
errors if functions might not compile
* use cpp feature detection macro instead of detecting compilers

Change-Id: I47d8b5e325e1528e672fd713d7622305ced1149d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tim Blechmann
2024-12-10 08:59:43 +08:00
parent 5cbe7d8819
commit 0e9943dd67
3 changed files with 3 additions and 7 deletions

View File

@@ -411,10 +411,6 @@ public:
BaseSqliteResultRange(BaseSqliteResultRange &) = delete; BaseSqliteResultRange(BaseSqliteResultRange &) = delete;
BaseSqliteResultRange &operator=(BaseSqliteResultRange &) = delete; BaseSqliteResultRange &operator=(BaseSqliteResultRange &) = delete;
BaseSqliteResultRange(BaseSqliteResultRange &&other)
: m_statement{std::move(other.resetter)}
{}
BaseSqliteResultRange &operator=(BaseSqliteResultRange &&) = delete; BaseSqliteResultRange &operator=(BaseSqliteResultRange &&) = delete;
iterator begin() & { return iterator{m_statement}; } iterator begin() & { return iterator{m_statement}; }

View File

@@ -147,7 +147,7 @@ public:
friend void convertToString(String &string, CompoundBasicId id) friend void convertToString(String &string, CompoundBasicId id)
{ {
convertToString(string, id.id); convertToString(string, id.id);
convertToString(string, id.contextId); convertToString(string, id.contextId());
} }
friend bool compareId(CompoundBasicId first, CompoundBasicId second) friend bool compareId(CompoundBasicId first, CompoundBasicId second)

View File

@@ -258,7 +258,7 @@ template<template<typename> class C, // result container type
typename Result = std::decay_t<std::invoke_result_t<F, Value&>>, typename Result = std::decay_t<std::invoke_result_t<F, Value&>>,
typename ResultContainer = C<Result>> typename ResultContainer = C<Result>>
Q_REQUIRED_RESULT decltype(auto) transform(SC &&container, F function); Q_REQUIRED_RESULT decltype(auto) transform(SC &&container, F function);
#ifdef Q_CC_CLANG #if __cpp_template_template_args < 201611L
// "Matching of template template-arguments excludes compatible templates" // "Matching of template template-arguments excludes compatible templates"
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html (P0522R0) // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html (P0522R0)
// in C++17 makes the above match e.g. C=std::vector even though that takes two // in C++17 makes the above match e.g. C=std::vector even though that takes two
@@ -833,7 +833,7 @@ Q_REQUIRED_RESULT decltype(auto) transform(SC &&container, F function)
return transform<ResultContainer>(std::forward<SC>(container), function); return transform<ResultContainer>(std::forward<SC>(container), function);
} }
#ifdef Q_CC_CLANG #if __cpp_template_template_args < 201611L
template<template<typename, typename> class C, // result container type template<template<typename, typename> class C, // result container type
typename SC, // input container type typename SC, // input container type
typename F, // function type typename F, // function type