Skip to content

Commit 07a741b

Browse files
committed
proxy-types: fix clang-tidy bugprone-use-after-move error
include/mp/proxy-types.h:399:70: error: 'values' used after it was forwarded [bugprone-use-after-move,-warnings-as-errors] 399 | ParamList(), Priority<1>(), std::forward<Values>(values)..., Make<StructField, Accessor>(params)); | ^ include/mp/proxy-types.h:396:17: note: forward occurred here 396 | MaybeBuildField(std::integral_constant<bool, Accessor::in>(), ParamList(), invoke_context,
1 parent 3673114 commit 07a741b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/mp/proxy-types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,15 @@ void MaybeReadField(std::false_type, Args&&...)
274274
}
275275

276276
template <typename LocalType, typename Value, typename Output>
277-
void MaybeSetWant(TypeList<LocalType*>, Priority<1>, Value&& value, Output&& output)
277+
void MaybeSetWant(TypeList<LocalType*>, Priority<1>, const Value& value, Output&& output)
278278
{
279279
if (value) {
280280
output.setWant();
281281
}
282282
}
283283

284284
template <typename LocalTypes, typename... Args>
285-
void MaybeSetWant(LocalTypes, Priority<0>, Args&&...)
285+
void MaybeSetWant(LocalTypes, Priority<0>, const Args&...)
286286
{
287287
}
288288

@@ -393,10 +393,10 @@ struct ClientParam
393393
void handleField(ClientInvokeContext& invoke_context, Params& params, ParamList)
394394
{
395395
auto const fun = [&]<typename... Values>(Values&&... values) {
396+
MaybeSetWant(
397+
ParamList(), Priority<1>(), values..., Make<StructField, Accessor>(params));
396398
MaybeBuildField(std::integral_constant<bool, Accessor::in>(), ParamList(), invoke_context,
397399
Make<StructField, Accessor>(params), std::forward<Values>(values)...);
398-
MaybeSetWant(
399-
ParamList(), Priority<1>(), std::forward<Values>(values)..., Make<StructField, Accessor>(params));
400400
};
401401

402402
// Note: The m_values tuple just consists of lvalue and rvalue

0 commit comments

Comments
 (0)