Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / static-init-2.C
blobd046b330b8586a784cd04623134f006d32e9a0da
1 // PR sanitizer/66190
2 // { dg-do run }
3 // { dg-options "-fsanitize=null -std=c++11" }
5 int
6 main ()
8   static int *a;
9   static int &b = *a;
10   static int &c (*a);
11   static int &d {*a};
12   return 0;
15 // { dg-output "reference binding to null pointer of type 'int'(\n|\r\n|\r)" }
16 // { dg-output "\[^\n\r]*reference binding to null pointer of type 'int'(\n|\r\n|\r)" }
17 // { dg-output "\[^\n\r]*reference binding to null pointer of type 'int'" }