Skip to content

Commit

Permalink
[ntcore] NetworkTableInstance: Suppress unused lambda capture warning
Browse files Browse the repository at this point in the history
Clang warns that the "this" capture is not required, even though a
member function is being called.
  • Loading branch information
PeterJohnson committed Nov 21, 2023
1 parent 0ca1e9b commit 9f53dbc
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -273,4 +279,8 @@ void NetworkTableInstance::AddStructSchema() {
});
}

#ifdef __clang__
#pragma clang diagnostic pop
#endif

} // namespace nt

0 comments on commit 9f53dbc

Please sign in to comment.