From b57d479d49a1be0081e7ec1053eb930036df76f5 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Tue, 13 Oct 2020 17:27:55 +0000 Subject: [PATCH] Fix clang11 warning Apparently clang11 warns if you pass uninitialized memory to a function accepting a const reference. Seems fair. This change doesn't actually fix any bugs, but it silences the warning. --- flow/flat_buffers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flow/flat_buffers.h b/flow/flat_buffers.h index b89ae6f69f..183d697e03 100644 --- a/flow/flat_buffers.h +++ b/flow/flat_buffers.h @@ -597,7 +597,7 @@ struct TraverseMessageTypes : Context { // we don't need to check for recursion here because the next call // to operator() will do that and we don't generate a vtable for the // vector-like type itself - T t; + T t{}; (*this)(t); } @@ -612,7 +612,7 @@ struct TraverseMessageTypes : Context { private: template void union_helper(pack) { - T t; + T t{}; (*this)(t); union_helper(pack{}); }