Debian Codegraph @

gcc/testsuite/g++.dg/ubsan/pr63813.C

raw
1 // PR sanitizer/63813
2 // { dg-do compile }
3 // { dg-options "-fsanitize=undefined -O1" }
4
5 struct A {};
6 struct B { long foo () const; A &bar () const; };
7
8 A &
9 B::bar () const
10 {
11 return *reinterpret_cast <A *> (foo ());
12 }