Commit graph

6 commits

Author SHA1 Message Date
Dan Klishch 500ff2a7ed AK: Declare AK::Coroutine<T>::CoroutinePromiseBase::unhandled_exception
For some reason, Clang wants AK to work with exceptions enabled so much
that it produces a very annoying warning complaining about the absence
of (completely useless in our setup) unhandled_exception method in
promise type for every coroutine declared. We work around this during
build by suppressing -Wcoroutine-missing-unhandled-exception in
Meta/CMake/common_compile_options.cmake. However, the flag is only added
if build is using Clang. If one builds coroutine code with GCC but still
uses clangd, clangd, obviously, doesn't pick up warning suppression and
annoys user with a squiggly yellow line under each coroutine function
declaration.
2024-08-29 13:28:42 +02:00
Dan Klishch c3e13ce420 AK: Do not return value from void must_sync<void>(...) 2024-08-29 13:28:42 +02:00
Dan Klishch c03cca7b2f AK+LibTest: Choose definition of CO_TRY and CO_TRY_OR_FAIL more robustly
There are three compiler bugs that influence this decision:

 - Clang writing to (validly) destroyed coroutine frame with -O0 and
   -fsanitize=null,address under some conditions
   (https://godbolt.org/z/17Efq5Ma5) (AK_COROUTINE_DESTRUCTION_BROKEN);

 - GCC being unable to handle statement expressions in coroutines
   (AK_COROUTINE_STATEMENT_EXPRS_BROKEN);

 - GCC being unable to deduce template type parameter for TryAwaiter
   with nested CO_TRYs (AK_COROUTINE_TYPE_DEDUCTION_BROKEN).

Instead of growing an ifdef soup in AK/Coroutine.h and
LibTest/AsyncTestCase.h, define three macros in AK/Platform.h that
correspond to these bugs and use them accordingly in the said files.
2024-06-29 20:15:05 -06:00
Dan Klishch 0f1d67f2f0 AK: Introduce AK::Generator 2024-06-13 17:40:24 +02:00
Dan Klishch 7fb6d24402 LibTest: Support asynchronous tests 2024-06-13 17:40:24 +02:00
Dan Klishch 8263e0a619 AK: Introduce AK::Coroutine 2024-06-13 17:40:24 +02:00