parent
60dcc1344a
commit
5f6100260b
|
@ -61,8 +61,8 @@ int main()
|
||||||
C c(std::begin(t), std::end(t));
|
C c(std::begin(t), std::end(t));
|
||||||
c.reserve(2*c.size());
|
c.reserve(2*c.size());
|
||||||
assert(is_contiguous_container_asan_correct(c));
|
assert(is_contiguous_container_asan_correct(c));
|
||||||
assert(!__sanitizer_verify_contiguous_container ( c.data(), c.data() + 1, c.data() + c.capacity()));
|
assert(!__sanitizer_verify_contiguous_container( c.data(), c.data() + 1, c.data() + c.capacity()));
|
||||||
T foo = c[c.size()]; // should trigger ASAN
|
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
|
assert(false); // if we got here, ASAN didn't trigger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,4 +25,5 @@ struct B : A {};
|
||||||
int main() {
|
int main() {
|
||||||
A* ptr = new B;
|
A* ptr = new B;
|
||||||
(void)dynamic_cast<B*>(ptr);
|
(void)dynamic_cast<B*>(ptr);
|
||||||
|
delete ptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue