Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c022eadc authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar
Browse files

FTL: Provide definition of BaseFuture where third template parameter is ftl::Future

Bug: 405867217

After https://github.com/llvm/llvm-project/pull/100692, clang is
stricter about template deductions.  This causes the following error in
future_test.cpp:

...s/native/include/ftl/future.h:34:29: error: implicit instantiation of
undefined template
'android::ftl::details::BaseFuture<android::ftl::Future<int,
android::ftl::Future>, int, android::ftl::Future>'
   34 | class Future final : public details::BaseFuture<Future<T, FutureImpl>, T, FutureImpl> {
      |                             ^
frameworks/native/libs/ftl/future_test.cpp:47:31: note: in
instantiation of template class 'android::ftl::Future<int,
android::ftl::Future>' requested here
   47 |     ftl::Future<char> chain = ftl::Future(std::move(future))
      |                          ^
frameworks/native/include/ftl/details/future.h:52:7: note: template is declared here
   52 | class BaseFuture;
      |       ^

This is because ftl/details/future.h only provides
an instantiation where the third template parameter is either a
std::future or a std::shared_future.  This change extends the
instantiation to support any FutureImpl.

Test: Build future_test.cpp with new clang and old clang, in addition to
      presubmit.
Flag: EXEMPT fix error during compiler update
Change-Id: I1795f1f1237f5209fd8138a20c4de2a921c7395b
parent a83d862d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment