summaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp
blob: a86960d12ad70ca18010bc78a35f8b54643ad634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr %s -o %t
// RUN: %run %t

// REQUIRES: cxxabi
// UNSUPPORTED: win32

int volatile n;

struct A { virtual ~A() {} };
struct B: virtual A {};
struct C: virtual A { ~C() { n = 0; } };
struct D: virtual B, virtual C {};

int main() { delete new D; }