mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
Everywhere: Fully qualify IsLvalueReference in TRY() macros
If USING_AK_GLOBALLY is not defined, the name IsLvalueReference might not be available in the global namespace. Follow the pattern established in LibTest to fully qualify AK types in macros to avoid this problem.
This commit is contained in:
parent
56512caa73
commit
f5d253dcfa
11 changed files with 96 additions and 95 deletions
|
@ -231,14 +231,14 @@ struct CLDR {
|
|||
|
||||
// Some parsing is expected to fail. For example, the CLDR contains language mappings
|
||||
// with locales such as "en-GB-oed" that are canonically invalid locale IDs.
|
||||
#define TRY_OR_DISCARD(expression) \
|
||||
({ \
|
||||
auto _temporary_result = (expression); \
|
||||
if (_temporary_result.is_error()) \
|
||||
return; \
|
||||
static_assert(!IsLvalueReference<decltype(_temporary_result.release_value())>, \
|
||||
"Do not return a reference from a fallible expression"); \
|
||||
_temporary_result.release_value(); \
|
||||
#define TRY_OR_DISCARD(expression) \
|
||||
({ \
|
||||
auto _temporary_result = (expression); \
|
||||
if (_temporary_result.is_error()) \
|
||||
return; \
|
||||
static_assert(!::AK::Detail::IsLvalueReference<decltype(_temporary_result.release_value())>, \
|
||||
"Do not return a reference from a fallible expression"); \
|
||||
_temporary_result.release_value(); \
|
||||
})
|
||||
|
||||
static ErrorOr<LanguageMapping> parse_language_mapping(CLDR& cldr, StringView key, StringView alias)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue