Skip to content

Commit

Permalink
pp: Addressed false positive use-after-move
Browse files Browse the repository at this point in the history
The motivation for this was because `clang-tidy` was throwing a possible
false-positive use-after-move.

Signed-off-by: Michael Boquard <[email protected]>
  • Loading branch information
michael-redpanda committed May 25, 2023
1 parent 30e26c4 commit a84b8b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/v/pandaproxy/rest/handlers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ create_consumer(server::request_t rq, server::reply_t rp) {
req_data.auto_offset_reset,
req_data.auto_commit_enable);

return client.get_consumer(group_id, req_data.name)
// clang-tidy 16.0.4 is reporting an erroneous 'use-after-move' error
// when calling `then` after `get_consumer`.
auto f = client.get_consumer(group_id, req_data.name);
return f
.then([group_id](const kafka::client::shared_consumer_t&) mutable {
auto ec = make_error_condition(
reply_error_code::consumer_already_exists);
Expand Down

0 comments on commit a84b8b6

Please sign in to comment.