Skip to content

Commit b73218d

Browse files
PeterJohnsonStarlight220
authored andcommitted
[ntcore] NetworkTableInstance: Suppress unused lambda capture warning (wpilibsuite#5947)
Clang warns that the "this" capture is not required, even though a member function is being called.
1 parent 55b3177 commit b73218d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ntcore/src/main/native/include/networktables/NetworkTableInstance.inc

+10
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ inline void NetworkTableInstance::AddSchema(std::string_view name,
257257
::nt::AddSchema(m_handle, name, type, schema);
258258
}
259259

260+
// Suppress unused-lambda-capture warning on AddSchema() call
261+
#ifdef __clang__
262+
#pragma clang diagnostic push
263+
#pragma clang diagnostic ignored "-Wunused-lambda-capture"
264+
#endif
265+
260266
template <wpi::ProtobufSerializable T>
261267
void NetworkTableInstance::AddProtobufSchema(wpi::ProtobufMessage<T>& msg) {
262268
msg.ForEachProtobufDescriptor(
@@ -273,4 +279,8 @@ void NetworkTableInstance::AddStructSchema() {
273279
});
274280
}
275281

282+
#ifdef __clang__
283+
#pragma clang diagnostic pop
284+
#endif
285+
276286
} // namespace nt

0 commit comments

Comments
 (0)