comparison gcc/testsuite/g++.dg/ubsan/null-8.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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 void
7 foo (const int &iref)
8 {
9 if (&iref)
10 __builtin_printf ("iref %d\n", iref);
11 else
12 __builtin_printf ("iref is NULL\n");
13 }
14
15 int
16 main ()
17 {
18 foo (*((int*) __null));
19 }