Fix asan unitialized warning when default-initialized int is copied as a return type

This commit is contained in:
Christian Mazakas
2022-02-11 10:16:29 -08:00
parent e3a7ec6aed
commit d2ded394f6

View File

@ -263,7 +263,9 @@ template <typename T> struct allocator3
allocator3<T> select_on_container_copy_construction() const
{
++selected;
return allocator3<T>();
allocator3<T> a;
a.x = 0;
return a;
}
};