repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
return-1.C
blob
4e24db0c2a773fe77bd77cdf3cdaaf73bc3b365f
1
// { dg-do run }
2
// { dg-options "-fsanitize=return -Wno-return-type" }
3
// { dg-shouldfail "ubsan" }
4
5
struct S { S (); ~S (); };
6
7
S::S () {}
8
S::~S () {}
9
10
int
11
foo (int x)
12
{
13
S a;
14
{
15
S b;
16
if (x)
17
return 1;
18
}
19
}
20
21
int
22
main ()
23
{
24
foo (0);
25
}
26
27
// { dg-output "execution reached the end of a value-returning function without returning a value" }