PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / pr69922.C
blob0392750427e4366031f5bafa512f08a9f11597d8
1 // PR c++/69922
2 // { dg-do compile }
3 // { dg-options "-fsanitize=vptr -Wnonnull-compare" }
5 struct S { virtual ~S (); };
6 struct T : S { T *bar (); T *baz (); T *q; bool b; };
8 T *
9 T::bar ()
11   return static_cast<T*>(reinterpret_cast<S*>(this));   // { dg-bogus "nonnull argument" }
14 T *
15 T::baz ()
17   return static_cast<T*>(reinterpret_cast<S*>(b ? this : q));   // { dg-bogus "nonnull argument" }