diff --git a/test/libcxx/containers/sequences/vector/asan.pass.cpp b/test/libcxx/containers/sequences/vector/asan.pass.cpp index b102fc08d..d3604f0c3 100644 --- a/test/libcxx/containers/sequences/vector/asan.pass.cpp +++ b/test/libcxx/containers/sequences/vector/asan.pass.cpp @@ -61,8 +61,8 @@ int main() C c(std::begin(t), std::end(t)); c.reserve(2*c.size()); assert(is_contiguous_container_asan_correct(c)); - assert(!__sanitizer_verify_contiguous_container ( c.data(), c.data() + 1, c.data() + c.capacity())); - T foo = c[c.size()]; // should trigger ASAN + assert(!__sanitizer_verify_contiguous_container( c.data(), c.data() + 1, c.data() + c.capacity())); + volatile T foo = c[c.size()]; // should trigger ASAN. Use volatile to prevent being optimized away. assert(false); // if we got here, ASAN didn't trigger } } diff --git a/test/support/test.support/test_macros_header_rtti.pass.cpp b/test/support/test.support/test_macros_header_rtti.pass.cpp index d189a0efc..dee1a0494 100644 --- a/test/support/test.support/test_macros_header_rtti.pass.cpp +++ b/test/support/test.support/test_macros_header_rtti.pass.cpp @@ -25,4 +25,5 @@ struct B : A {}; int main() { A* ptr = new B; (void)dynamic_cast(ptr); + delete ptr; }