[ntcore] NetworkTableInstance: Suppress unused lambda capture warning (#5947)

Clang warns that the "this" capture is not required, even though a
member function is being called.
This commit is contained in:
Peter Johnson
2023-11-21 09:45:16 -08:00
committed by GitHub
parent bdc8620d55
commit 4a44210ee3

View File

@@ -257,6 +257,12 @@ inline void NetworkTableInstance::AddSchema(std::string_view name,
::nt::AddSchema(m_handle, name, type, schema);
}
// Suppress unused-lambda-capture warning on AddSchema() call
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-lambda-capture"
#endif
template <wpi::ProtobufSerializable T>
void NetworkTableInstance::AddProtobufSchema(wpi::ProtobufMessage<T>& msg) {
msg.ForEachProtobufDescriptor(
@@ -273,4 +279,8 @@ void NetworkTableInstance::AddStructSchema() {
});
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
} // namespace nt