diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-02-22 02:37:24 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-23 13:59:33 +0100 |
commit | 347d741afba39947d40f6efb567fa02b95d20e7f (patch) | |
tree | 58706c0db460c83e62a36836550a3c255ad11dc7 /AK/TestSuite.h | |
parent | 29c8d34be737265b2f8362c60f6730b16ddec1b8 (diff) | |
download | serenity-347d741afba39947d40f6efb567fa02b95d20e7f.zip |
AK+Userland: Extend the compiletime format string check to other functions
Thanks to @trflynn89 for the neat implicit consteval ctor trick!
This allows us to basically slap `CheckedFormatString` on any
formatting function, and have its format argument checked at compiletime.
Note that there is a validator bug where it doesn't parse inner replaced
fields like `{:~>{}}` correctly (what should be 'left align with next
argument as size' is parsed as `{:~>{` following a literal closing
brace), so the compiletime checks are disabled on these temporarily by
forcing them to be StringViews.
This commit also removes the now unused `AK::StringLiteral` type (which
was introduced for use with NTTP strings).
Diffstat (limited to 'AK/TestSuite.h')
-rw-r--r-- | AK/TestSuite.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/TestSuite.h b/AK/TestSuite.h index 0eee0be61a..9c5e7ed9e5 100644 --- a/AK/TestSuite.h +++ b/AK/TestSuite.h @@ -27,11 +27,12 @@ #pragma once #include <AK/Assertions.h> +#include <AK/CheckedFormatString.h> namespace AK { template<typename... Parameters> -void warnln(const char* fmtstr, const Parameters&...); +void warnln(CheckedFormatString<Parameters...>&& fmtstr, const Parameters&...); } |