LibTest: Use Array instead of fold expression in __testjs_last()

This avoids a -Wunused-value warning with clang-14.
This commit is contained in:
Andrew Kaster 2022-01-06 22:49:37 -07:00 committed by Ali Mohammad Pur
parent e2e9560580
commit d1e3470438
Notes: sideshowbarker 2024-07-17 21:30:56 +09:00

View file

@ -107,7 +107,11 @@ template<typename... Args>
static consteval size_t __testjs_count(Args...) { return sizeof...(Args); }
template<auto... Values>
static consteval size_t __testjs_last() { return (AK::Detail::IntegralConstant<size_t, Values> {}, ...).value; }
static consteval size_t __testjs_last()
{
Array values { Values... };
return values[values.size() - 1U];
}
static constexpr auto TOP_LEVEL_TEST_NAME = "__$$TOP_LEVEL$$__";
extern RefPtr<JS::VM> g_vm;