From 8a2f6bec33c6a250a6f5793a45c87e320e446214 Mon Sep 17 00:00:00 2001 From: Gregory Tsipenyuk Date: Wed, 28 Feb 2024 09:34:22 -0500 Subject: [PATCH] fix compile error on gcc 13: (#4932) The compilation fails due to an issue in the initializer list of an optional argument, which holds a vector of pairs. The code compiles correctly on earlier gcc versions, but fails on gcc 13. --- src/test/rpc/GetAggregatePrice_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/rpc/GetAggregatePrice_test.cpp b/src/test/rpc/GetAggregatePrice_test.cpp index 076a50443e8..4c45b7b9d2b 100644 --- a/src/test/rpc/GetAggregatePrice_test.cpp +++ b/src/test/rpc/GetAggregatePrice_test.cpp @@ -35,10 +35,10 @@ class GetAggregatePrice_test : public beast::unit_test::suite { testcase("Errors"); using namespace jtx; + using Oracles = std::vector>; Account const owner{"owner"}; Account const some{"some"}; - static std::vector> oracles = { - {owner, 1}}; + static Oracles oracles = {{owner, 1}}; { Env env(*this); @@ -62,7 +62,7 @@ class GetAggregatePrice_test : public beast::unit_test::suite "Missing field 'oracles'."); // empty oracles array - ret = Oracle::aggregatePrice(env, "XRP", "USD", {{}}); + ret = Oracle::aggregatePrice(env, "XRP", "USD", Oracles{}); BEAST_EXPECT(ret[jss::error].asString() == "oracleMalformed"); // invalid oracle document id