PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / null-8.C
blobcea289ec2613568e4972ad7dc1d1d8b9afc965c2
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'" }
6 __attribute__((noinline, noclone))
7 void
8 bar (int x)
10   asm volatile ("" : : "r" (x) : "memory");
13 void
14 foo (const int &iref)
16   if (&iref)
17     bar (iref);
18   else
19     bar (1);
22 int
23 main ()
25   foo (*((int*) __null));