Skip to content

Commit 0305fdb

Browse files
authored
Merge pull request #171 from mapbox/jrex-mute-clang-analyzer
Add explicit initialization of data to mute clang static analyzer warnings
2 parents 52df276 + 2fef61f commit 0305fdb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/mapbox/variant.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,12 @@ class variant
583583
using helper_type = detail::variant_helper<Types...>;
584584

585585
type_index_t type_index;
586+
#ifdef __clang_analyzer__
587+
data_type data {};
588+
#else
586589
data_type data;
587-
590+
#endif
591+
588592
public:
589593
VARIANT_INLINE variant() noexcept(std::is_nothrow_default_constructible<first_type>::value)
590594
: type_index(sizeof...(Types)-1)

0 commit comments

Comments
 (0)