mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 13:46:31 +00:00
AK: Fix usage of constexpr within Utf16View and related utilities
* Error and ErrorOr are not themelves constexpr, so a function returning these types cannot be constexpr. * The UDL was trying to call Utf16View::validate, which is not constexpr itself. The compiler will actually already raise an error if a UTF-16 literal is invalid, so let's just avoid the call altogether.
This commit is contained in:
parent
778759517e
commit
418409aa6f
Notes:
github-actions[bot]
2025-07-04 13:26:29 +00:00
Author: https://github.com/trflynn89
Commit: 418409aa6f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5299
Reviewed-by: https://github.com/shannonbooth ✅
2 changed files with 3 additions and 5 deletions
|
@ -137,7 +137,7 @@ template<typename Callback>
|
|||
}
|
||||
|
||||
template<FallibleFunction<char16_t> Callback>
|
||||
constexpr ErrorOr<size_t> try_code_point_to_utf16(u32 code_point, Callback callback)
|
||||
ALWAYS_INLINE ErrorOr<size_t> try_code_point_to_utf16(u32 code_point, Callback callback)
|
||||
{
|
||||
if (code_point < FIRST_SUPPLEMENTARY_PLANE_CODE_POINT) {
|
||||
TRY(callback(static_cast<char16_t>(code_point)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue