From 7d71c0f689505c1a41452d1b9fbea5ccde72de9d Mon Sep 17 00:00:00 2001 From: Perdixky <105138864+Perdixky@users.noreply.github.com> Date: Wed, 29 Oct 2025 09:45:42 +0800 Subject: [PATCH] [Fix] GCC compilation issue caused by template specialization (#287) --- include/Async/Task.h | 6 ++++-- include/Support/JSON.h | 2 +- include/Support/Struct.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/Async/Task.h b/include/Async/Task.h index 334d9ca7..7c506e2a 100644 --- a/include/Async/Task.h +++ b/include/Async/Task.h @@ -198,8 +198,10 @@ public: } }; - template <> - struct promise_result { + // WORKAROUND: GCC bug - full specialization in non-namespace scope not supported + // see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282 + template V> + struct promise_result { void return_void() noexcept {} }; diff --git a/include/Support/JSON.h b/include/Support/JSON.h index b08c1254..8182793a 100644 --- a/include/Support/JSON.h +++ b/include/Support/JSON.h @@ -175,7 +175,7 @@ struct Serde { } }; -template +template struct Serde> { using V = llvm::SmallString; diff --git a/include/Support/Struct.h b/include/Support/Struct.h index 30201a7d..4fdac547 100644 --- a/include/Support/Struct.h +++ b/include/Support/Struct.h @@ -300,7 +300,7 @@ template struct Struct> { constexpr inline static bool reflectable_struct = (refl::reflectable_struct && ...); - constexpr static std::size_t member_count = (Struct::member_count + ...); + constexpr static std::size_t member_count = (impl::member_count() + ...); template constexpr static auto collect_members(Object&& object) {