[libcxx-commits] [libcxx] [ASan][libc++] Annotating `std::basic_string` with all allocators (PR #75845)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Dec 20 14:01:11 PST 2023
================
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: asan
+// UNSUPPORTED: c++03
+
+// <string>
+
+// Test based on: https://bugs.chromium.org/p/chromium/issues/detail?id=1419798#c5
+// Some allocators during deallocation may not call destructors and just reuse memory.
----------------
EricWF wrote:
Could you copy and paste most of your comment into this test?
Could you also add comments throughout making it clear exactly what we intend to happen. I find the repeated push_back calls to be a bit confusing when trying to figure out exactly what the test expects to allocate and when.
In general, because this test is so close to UB, I would be be sure the meaning of each weird bit of the test is clear to the reader. I wasn't fully onboard with the test after initially reading the chrome bug and comment.
https://github.com/llvm/llvm-project/pull/75845
More information about the libcxx-commits
mailing list