From 11ebcde5c2caa6c35f8e3b06d8227e77ccef8881 Mon Sep 17 00:00:00 2001 From: J Reece Wilson Date: Mon, 4 Apr 2022 07:55:47 +0100 Subject: [PATCH] [*] Conformity - Clang Fixes --- Include/auROXTL/auContainerUtils.hpp | 6 +++--- Include/auROXTL/auMemoryModel.hpp | 6 +++++- Include/auROXTL/auTemplateMeta.hpp | 4 ++-- Include/auROXTL/auTemplateMetaIsFunction.hpp | 11 ++++++++++- Include/auROXTL/auTuple.hpp | 8 ++++++-- Include/auROXTL/auTupleUtils.hpp | 4 ++-- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Include/auROXTL/auContainerUtils.hpp b/Include/auROXTL/auContainerUtils.hpp index 864565b..d79f818 100644 --- a/Include/auROXTL/auContainerUtils.hpp +++ b/Include/auROXTL/auContainerUtils.hpp @@ -64,8 +64,8 @@ namespace __audetail template struct AuHasfind { - template static constexpr AuTrueType Test(decltype(static_cast(&C::find))); - template static constexpr AuTrueType Test(decltype(static_cast(&C::find))); + template static constexpr AuTrueType Test(decltype(static_cast(&C::find))); + template static constexpr AuTrueType Test(decltype(static_cast(&C::find))); template static constexpr AuFalseType Test(...); using type = decltype(Test(0)); }; @@ -76,7 +76,7 @@ namespace __audetail template struct AuHasend { - template static constexpr AuTrueType Test(decltype(static_cast(&C::end))); + template static constexpr AuTrueType Test(decltype(static_cast(&C::end))); template static constexpr AuFalseType Test(...); using type = decltype(Test(0)); }; diff --git a/Include/auROXTL/auMemoryModel.hpp b/Include/auROXTL/auMemoryModel.hpp index 14110a9..f8c52f1 100644 --- a/Include/auROXTL/auMemoryModel.hpp +++ b/Include/auROXTL/auMemoryModel.hpp @@ -154,6 +154,10 @@ static void auline AuSafeDelete(T *in) #endif +// TODO: Move me +#include "auOptional.hpp" +#include "auCastUtils.hpp" + namespace Aurora::Memory { #if defined(AURORA_ROXTL_ALLOCATORS_USE_STD) @@ -186,7 +190,7 @@ namespace Aurora::Memory { } - inline [[nodiscard]] constexpr T* allocate(Types::size_t n) + inline constexpr T* allocate(Types::size_t n) { if (auto p = (__FAlloc(n * sizeof(T), alignof(T)))) { diff --git a/Include/auROXTL/auTemplateMeta.hpp b/Include/auROXTL/auTemplateMeta.hpp index 07a74fb..e59352a 100644 --- a/Include/auROXTL/auTemplateMeta.hpp +++ b/Include/auROXTL/auTemplateMeta.hpp @@ -288,8 +288,8 @@ using AuEnableIf_t = typename AuEnableIf::type; template struct AuIsConstructible { - template static constexpr AuTrueType Test(decltype(T(AuDeclVal()...))); - template static constexpr AuFalseType Test(...); + template static constexpr AuTrueType Test(decltype(C(AuDeclVal()...))); + static constexpr AuFalseType Test(...); using type = decltype(Test(0)); }; diff --git a/Include/auROXTL/auTemplateMetaIsFunction.hpp b/Include/auROXTL/auTemplateMetaIsFunction.hpp index 20c4e73..4294560 100644 --- a/Include/auROXTL/auTemplateMetaIsFunction.hpp +++ b/Include/auROXTL/auTemplateMetaIsFunction.hpp @@ -8,6 +8,11 @@ ***/ #pragma once +#if defined(AURORA_COMPILER_CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wambiguous-ellipsis" +#endif + // primary template @@ -169,4 +174,8 @@ template struct AuIsFunction : AuTrueType {}; template -inline constexpr bool AuIsFunction_v = AuIsFunction::value; \ No newline at end of file +inline constexpr bool AuIsFunction_v = AuIsFunction::value; + +#if defined(AURORA_COMPILER_CLANG) +#pragma clang diagnostic pop +#endif \ No newline at end of file diff --git a/Include/auROXTL/auTuple.hpp b/Include/auROXTL/auTuple.hpp index 75f3348..94912bf 100644 --- a/Include/auROXTL/auTuple.hpp +++ b/Include/auROXTL/auTuple.hpp @@ -21,5 +21,9 @@ using AuPair = AURORA_RUNTIME_AU_PAIR; #define AURORA_RUNTIME_AU_TUPLE std::tuple #endif -template -using AuTuple = AURORA_RUNTIME_AU_TUPLE; \ No newline at end of file +#if defined(AURORA_COMPILER_CLANG) + #define AuTuple std::tuple +#else + template + using AuTuple = AURORA_RUNTIME_AU_TUPLE; +#endif \ No newline at end of file diff --git a/Include/auROXTL/auTupleUtils.hpp b/Include/auROXTL/auTupleUtils.hpp index 08aa9fc..a872727 100644 --- a/Include/auROXTL/auTupleUtils.hpp +++ b/Include/auROXTL/auTupleUtils.hpp @@ -144,7 +144,7 @@ static constexpr AuTuple AuTupleForward(Args&& ... args) // Stolen: https://codereview.stackexchange.com/questions/193420/apply-a-function-to-each-element-of-a-tuple-map-a-tuple namespace __audetail { - template + template static auto AuTupleTransformImpl(const Fn &fn, Argument &&argument, AuIndexSequence) { if constexpr (sizeof...(Ns) == 0) @@ -171,7 +171,7 @@ namespace __audetail } } -template +template static auto AuTupleTransform(const AuTuple &tuple, const Invokable &translate) { return __audetail::AuTupleTransformImpl(translate,