blob: fb9d15cc99ef7eb88b9b0f1e11e536ec090bae4b [file] [log] [blame]
// { dg-do run }
// { dg-options "-fsanitize=vptr" }
struct S
{
S() : a(0) {}
~S() {}
int a;
int f() { return 0; }
virtual int v() { return 0; }
};
struct T : S
{
T() : b(0) {}
int b;
int g() { return 0; }
virtual int v() { return 1; }
};
T *
foo (S *p)
{
return (T *) p;
}
int
main ()
{
if (foo (__null) != __null)
__builtin_abort ();
}