PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / vptr-12.C
blobf23bbc3fd10d2b799eaa75a9b7e38458403526e9
1 // { dg-do run }
2 // { dg-shouldfail "ubsan" }
3 // { dg-options "-fsanitize=vptr -fno-sanitize-recover=vptr" }
5 struct MyClass
7   virtual ~MyClass () {}
8   virtual void Doit () {}
9 };
11 int
12 main ()
14   MyClass *c = new MyClass;
15   c->~MyClass ();
16   c->Doit ();
18   return 0;
21 // { dg-output "\[^\n\r]*vptr-12.C:16:\[0-9]*: runtime error: member call on address 0x\[0-9a-fA-F]* which does not point to an object of type 'MyClass'(\n|\r\n|\r)" }
22 // { dg-output "0x\[0-9a-fA-F]*: note: object has invalid vptr" }