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>
diff --git a/src/tint/utils/vector.h b/src/tint/utils/vector.h
index 7e2c271..83e1c12 100644
--- a/src/tint/utils/vector.h
+++ b/src/tint/utils/vector.h
@@ -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 @@
/// 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.