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
PR c++/86728 - C variadic generic lambda.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ubsan
/
null-8.C
blob
cea289ec2613568e4972ad7dc1d1d8b9afc965c2
1
// PR c++/79572
2
// { dg-do run }
3
// { dg-options "-fsanitize=null -std=c++14" }
4
// { dg-output "reference binding to null pointer of type 'const int'" }
5
6
__attribute__((noinline, noclone))
7
void
8
bar (int x)
9
{
10
asm volatile ("" : : "r" (x) : "memory");
11
}
12
13
void
14
foo (const int &iref)
15
{
16
if (&iref)
17
bar (iref);
18
else
19
bar (1);
20
}
21
22
int
23
main ()
24
{
25
foo (*((int*) __null));
26
}