Skip to content

Commit

Permalink
Do not use temporaries in co_await expressions (g++ compiler bug)
Browse files Browse the repository at this point in the history
Summary: related to T13767

Reviewers: iljazovic

Reviewed By: iljazovic

Subscribers: miljen

Differential Revision: https://repo.mireo.local/D29449
  • Loading branch information
ksimicevic committed May 15, 2024
1 parent 68840dd commit dc2b2d9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/integration/mqtt_features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ asio::awaitable<void> test_subscription_identifiers() {
client.brokers(broker)
.async_run(asio::detached);

publish_props pprops;
auto&& [ec_1, rc_1, _] = co_await client.async_publish<qos_e::at_least_once>(
topic, payload, retain_e::yes, publish_props {}, use_nothrow_awaitable
topic, payload, retain_e::yes, pprops, use_nothrow_awaitable
);
BOOST_TEST_WARN(!ec_1);
BOOST_TEST_WARN(!rc_1);
Expand All @@ -98,9 +99,9 @@ asio::awaitable<void> test_subscription_identifiers() {
sprops[prop::subscription_identifier] = sub_id;

subscribe_options sub_opts = { .no_local = no_local_e::no };

subscribe_topic sub_topic = { share_topic, sub_opts };
auto&& [ec_2, rcs, __] = co_await client.async_subscribe(
{ topic, sub_opts }, sprops, use_nothrow_awaitable
sub_topic, sprops, use_nothrow_awaitable
);
BOOST_TEST_WARN(!ec_2);
BOOST_TEST_WARN(!rcs[0]);
Expand Down Expand Up @@ -128,16 +129,18 @@ asio::awaitable<void> test_shared_subscription() {
.async_run(asio::detached);

subscribe_options sub_opts = { .no_local = no_local_e::no };

subscribe_topic sub_topic = { share_topic, sub_opts };
subscribe_props sprops;
auto&& [ec_1, rcs, __] = co_await client.async_subscribe(
{ share_topic, sub_opts}, subscribe_props {}, use_nothrow_awaitable
sub_topic, sprops, use_nothrow_awaitable
);
BOOST_TEST_WARN(!ec_1);
BOOST_TEST_WARN(!rcs[0]);

publish_props pprops;
// shared subscriptions do not send Retained Messages on first subscribe
auto&& [ec_2, rc_2, _] = co_await client.async_publish<qos_e::at_least_once>(
topic, payload, retain_e::no, publish_props{}, use_nothrow_awaitable
topic, payload, retain_e::no, pprops, use_nothrow_awaitable
);
BOOST_TEST_WARN(!ec_2);
BOOST_TEST_WARN(!rc_2);
Expand Down

0 comments on commit dc2b2d9

Please sign in to comment.