mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibTest: Use Array instead of fold expression in __testjs_last()
This avoids a -Wunused-value warning with clang-14.
This commit is contained in:
parent
e2e9560580
commit
d1e3470438
Notes:
sideshowbarker
2024-07-17 21:30:56 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/d1e3470438a Pull-request: https://github.com/SerenityOS/serenity/pull/11689
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue