tint/utils: Vector::Clear: disable "maybe initialized" warning
Bug: 1607 Change-Id: I0da8ff0ddfe8ff09b06268333f7d1cf0285b2eba Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/113060 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
8515312a08
commit
94751e1a7d
|
@ -27,6 +27,7 @@
|
|||
#include "src/tint/castable.h"
|
||||
#include "src/tint/traits.h"
|
||||
#include "src/tint/utils/bitcast.h"
|
||||
#include "src/tint/utils/compiler_macros.h"
|
||||
#include "src/tint/utils/string.h"
|
||||
|
||||
namespace tint::utils {
|
||||
|
@ -395,10 +396,12 @@ class Vector {
|
|||
|
||||
/// Clears all elements from the vector, keeping the capacity the same.
|
||||
void Clear() {
|
||||
TINT_BEGIN_DISABLE_WARNING(MAYBE_UNINITIALIZED);
|
||||
for (size_t i = 0; i < impl_.slice.len; i++) {
|
||||
impl_.slice.data[i].~T();
|
||||
}
|
||||
impl_.slice.len = 0;
|
||||
TINT_END_DISABLE_WARNING(MAYBE_UNINITIALIZED);
|
||||
}
|
||||
|
||||
/// Appends a new element to the vector.
|
||||
|
|
Loading…
Reference in New Issue