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
c++: constantness of call to function pointer [PR111703]
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
vptr-5.C
blob
fb9d15cc99ef7eb88b9b0f1e11e536ec090bae4b
1
// { dg-do run }
2
// { dg-options "-fsanitize=vptr" }
3
4
struct S
5
{
6
S() : a(0) {}
7
~S() {}
8
int a;
9
int f() { return 0; }
10
virtual int v() { return 0; }
11
};
12
13
struct T : S
14
{
15
T() : b(0) {}
16
int b;
17
int g() { return 0; }
18
virtual int v() { return 1; }
19
};
20
21
T *
22
foo (S *p)
23
{
24
return (T *) p;
25
}
26
27
int
28
main ()
29
{
30
if (foo (__null) != __null)
31
__builtin_abort ();
32
}