Skip to content

Commit 866121f

Browse files
committed
Corrected compilation with Clang16 and GCC 12
1 parent 6101be3 commit 866121f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

include/kangaru/detail/recursive_source.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ namespace kangaru {
345345
}
346346
};
347347

348+
// This deduction guide is required for clang 16 to work
349+
template<rebindable_source Source>
350+
with_recursion(Source const& source) -> with_recursion<Source>;
351+
348352
template<forwarded_source Source>
349353
inline constexpr auto make_source_with_recursion(Source&& source) {
350354
return with_recursion<std::decay_t<Source>>{KANGARU5_FWD(source)};

include/kangaru/detail/source_helper.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "source.hpp"
55
#include "source_reference_wrapper.hpp"
6+
#include "utility.hpp"
67

78
#include <type_traits>
89
#include <concepts>
@@ -51,9 +52,10 @@ namespace kangaru {
5152
concept transparent_rebindable_wrapping_source =
5253
wrapping_source<Source>
5354
and requires(Source source) {
54-
typename detail::source_helper::rebind_wrapper<std::remove_cv_t<Source>>::template ttype<
55+
// Here we need to used ttype_t instead of directly using ::ttype<...>::type because GCC 12 has issues with it.
56+
typename detail::utility::ttype_t<detail::source_helper::rebind_wrapper<std::remove_cv_t<Source>>,
5557
std::decay_t<decltype(source.source)>
56-
>::type;
58+
>;
5759
};
5860

5961
template<typename Source>

include/kangaru/detail/utility.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ namespace kangaru::detail::utility {
8181

8282
template<typename T>
8383
using type_identity = T;
84+
85+
template<typename TType, typename... Ts>
86+
using ttype_t = typename TType::template ttype<Ts...>::type;
8487
}
8588

8689
#include "undef.hpp"

0 commit comments

Comments
 (0)