Fix compile error on clang14.0.3 (#577)

Fixes #578
This commit is contained in:
cyan317
2023-04-04 12:55:43 +01:00
committed by GitHub
parent a1f93b09f7
commit 3320125d8f
5 changed files with 5 additions and 10 deletions

View File

@@ -19,6 +19,9 @@ if(PACKAGING)
add_definitions(-DPKG=1) add_definitions(-DPKG=1)
endif() endif()
#c++20 removed std::result_of but boost 1.75 is still using it.
add_definitions(-DBOOST_ASIO_HAS_STD_INVOKE_RESULT=1)
add_library(clio) add_library(clio)
target_compile_features(clio PUBLIC cxx_std_20) target_compile_features(clio PUBLIC cxx_std_20)
target_include_directories(clio PUBLIC src) target_include_directories(clio PUBLIC src)

View File

@@ -111,7 +111,7 @@ synchronous(F&& f)
* R is the currently executing coroutine that is about to get passed. * R is the currently executing coroutine that is about to get passed.
* If corountine types do not match, the current one's type is stored. * If corountine types do not match, the current one's type is stored.
*/ */
using R = typename std::result_of<F(boost::asio::yield_context&)>::type; using R = typename boost::result_of<F(boost::asio::yield_context&)>::type;
if constexpr (!std::is_same<R, void>::value) if constexpr (!std::is_same<R, void>::value)
{ {
/** /**

View File

@@ -178,7 +178,7 @@ public:
{ {
for (auto const& handler : handlers) for (auto const& handler : handlers)
{ {
handlerMap_[handler.method] = move(handler); handlerMap_[handler.method] = std::move(handler);
} }
} }

View File

@@ -988,7 +988,6 @@ TEST_F(BackendTest, Basic)
Backend::LedgerPage page; Backend::LedgerPage page;
std::vector<Backend::LedgerObject> retObjs; std::vector<Backend::LedgerObject> retObjs;
size_t numLoops = 0;
do do
{ {
uint32_t limit = 10; uint32_t limit = 10;
@@ -1000,7 +999,6 @@ TEST_F(BackendTest, Basic)
retObjs.end(), retObjs.end(),
page.objects.begin(), page.objects.begin(),
page.objects.end()); page.objects.end());
++numLoops;
} while (page.cursor); } while (page.cursor);
for (auto obj : objs) for (auto obj : objs)
@@ -2343,7 +2341,6 @@ TEST_F(BackendTest, cacheIntegration)
} }
Backend::LedgerPage page; Backend::LedgerPage page;
std::vector<Backend::LedgerObject> retObjs; std::vector<Backend::LedgerObject> retObjs;
size_t numLoops = 0;
do do
{ {
uint32_t limit = 10; uint32_t limit = 10;
@@ -2355,7 +2352,6 @@ TEST_F(BackendTest, cacheIntegration)
retObjs.end(), retObjs.end(),
page.objects.begin(), page.objects.begin(),
page.objects.end()); page.objects.end());
++numLoops;
} while (page.cursor); } while (page.cursor);
for (auto obj : objs) for (auto obj : objs)
{ {

View File

@@ -893,7 +893,6 @@ TEST_F(BackendCassandraTest, Basic)
Backend::LedgerPage page; Backend::LedgerPage page;
std::vector<Backend::LedgerObject> retObjs; std::vector<Backend::LedgerObject> retObjs;
size_t numLoops = 0;
do do
{ {
uint32_t limit = 10; uint32_t limit = 10;
@@ -903,7 +902,6 @@ TEST_F(BackendCassandraTest, Basic)
retObjs.end(), retObjs.end(),
page.objects.begin(), page.objects.begin(),
page.objects.end()); page.objects.end());
++numLoops;
} while (page.cursor); } while (page.cursor);
for (auto obj : objs) for (auto obj : objs)
@@ -1544,7 +1542,6 @@ TEST_F(BackendCassandraTest, CacheIntegration)
} }
Backend::LedgerPage page; Backend::LedgerPage page;
std::vector<Backend::LedgerObject> retObjs; std::vector<Backend::LedgerObject> retObjs;
size_t numLoops = 0;
do do
{ {
uint32_t limit = 10; uint32_t limit = 10;
@@ -1554,7 +1551,6 @@ TEST_F(BackendCassandraTest, CacheIntegration)
retObjs.end(), retObjs.end(),
page.objects.begin(), page.objects.begin(),
page.objects.end()); page.objects.end());
++numLoops;
} while (page.cursor); } while (page.cursor);
for (auto obj : objs) for (auto obj : objs)
{ {