Explicitly initialize prevector::_union to avoid new warning

Warning from gcc 7.1 is ./prevector.h:450:25: warning:
'*((void*)(&<anonymous>)+8).prevector<28, unsigned char>::_union.prevector<28, unsigned char>::direct_or_indirect::<anonymous>.prevector<28, unsigned char>::direct_or_indirect::<unnamed struct>::indirect'
may be used uninitialized in this function [-Wmaybe-uninitialized]
pull/384/head
Matt Corallo 7 years ago
parent 1016dacfac
commit c73b8be244

@ -220,7 +220,7 @@ public:
}
}
prevector() : _size(0) {}
prevector() : _size(0), _union{{}} {}
explicit prevector(size_type n) : _size(0) {
resize(n);

Loading…
Cancel
Save