Debian Codegraph @

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

raw
1 // PR c++/116449
2 // { dg-do compile }
3 // { dg-options "-O2 -Wall -fsanitize=undefined" }
4
5 struct C { void foo (int); void bar (); int c[16]; };
6 typedef void (C::*P) ();
7 struct D { P d; };
8 static D e[1] = { { &C::bar } };
9
10 void
11 C::foo (int x)
12 {
13 (this->*e[c[x]].d) ();
14 }