Silence spurious GCC warning in std::variant

This commit is contained in:
Robbert van der Helm
2022-09-12 16:50:04 +02:00
parent 833df917a7
commit 0854deeae2
+13
View File
@@ -1014,6 +1014,17 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
should_log_response = logger.log_request(is_host_plugin, object); should_log_response = logger.log_request(is_host_plugin, object);
} }
// FIXME: For some reason you get a -Wmaybe-uninitialized false positive with
// GCC 12.2.0 on the `Request<T>` variant destructor here when used with
// `ClapAudioThreadControlRequest`.
//
// Oh and Clang doesn't know about -Wmaybe-uninitialized, so we need to
// ignore some more warnings here to get clangd to not complain
#pragma GCC diagnostic push
#if defined(__GNUC__) && !defined(__llvm__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
// A socket only handles a single request at a time as to prevent // A socket only handles a single request at a time as to prevent
// messages from arriving out of order. `AdHocSocketHandler::send()` // messages from arriving out of order. `AdHocSocketHandler::send()`
// will either use a long-living primary socket, or if that's currently // will either use a long-living primary socket, or if that's currently
@@ -1023,6 +1034,8 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
read_object<TResponse>(socket, response_object, buffer); read_object<TResponse>(socket, response_object, buffer);
}); });
#pragma GCC diagnostic pop
if (should_log_response) { if (should_log_response) {
auto [logger, is_host_plugin] = *logging; auto [logger, is_host_plugin] = *logging;
logger.log_response(!is_host_plugin, response_object); logger.log_response(!is_host_plugin, response_object);