Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / pr65019.C
blob380c10b65d1ede3816617a034905bed23efab120
1 // PR sanitizer/65019
2 // { dg-do compile }
3 // { dg-options "-fsanitize=alignment,object-size,vptr -std=c++11 -O2 -fcompare-debug" }
5 struct A { };
6 struct B { };
7 struct C final {
8   C (const A &, int);
9   static B *foo (const A &, int = 1);
10   virtual ~C ();
11   void *c;
14 B *
15 C::foo (const A &x, int y)
17   C *d = new C (x, y);
18   if (d->c == nullptr)
19     delete d;
21   return 0;
24 C::~C ()