mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:27:35 +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
|
@ -184,14 +184,14 @@ private:
|
|||
};
|
||||
|
||||
// This is a special variant of TRY() that also updates the socket's SO_ERROR field on error.
|
||||
#define SOCKET_TRY(expression) \
|
||||
({ \
|
||||
auto result = (expression); \
|
||||
if (result.is_error()) \
|
||||
return set_so_error(result.release_error()); \
|
||||
static_assert(!IsLvalueReference<decltype(result.release_value())>, \
|
||||
"Do not return a reference from a fallible expression"); \
|
||||
result.release_value(); \
|
||||
#define SOCKET_TRY(expression) \
|
||||
({ \
|
||||
auto result = (expression); \
|
||||
if (result.is_error()) \
|
||||
return set_so_error(result.release_error()); \
|
||||
static_assert(!::AK::Detail::IsLvalueReference<decltype(result.release_value())>, \
|
||||
"Do not return a reference from a fallible expression"); \
|
||||
result.release_value(); \
|
||||
})
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue