Debian Codegraph @

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

raw
1 // PR c++/81212
2 // { dg-do compile }
3 // { dg-options "-Wreturn-type -fsanitize=return" }
4
5 struct S
6 {
7 S (void *);
8 void *s;
9 };
10
11 S
12 foo (bool x, void *y)
13 {
14 if (x)
15 return S (y);
16 } // { dg-warning "control reaches end of non-void function" }