2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / pr63813.C
blob6ca5b2d18c9abeee1610176219196cc66e4749e5
1 // PR sanitizer/63813
2 // { dg-do compile }
3 // { dg-options "-fsanitize=undefined -O1" }
5 struct A {};
6 struct B { long foo () const; A &bar () const; };
8 A &
9 B::bar () const
11   return *reinterpret_cast <A *> (foo ());