c: Implement C23 nullptr (N3042)
[official-gcc.git] / gcc / testsuite / gcc.dg / c2x-nullptr-5.c
blob27803f7d03fc06b17432c7537a44711a08c53a3a
1 /* Test that we don't lose side-effects when converting from nullptr_t. */
2 /* { dg-do run } */
3 /* { dg-options "-std=c2x -pedantic-errors" } */
5 int i;
6 nullptr_t fn () { ++i; return nullptr; }
8 int
9 main ()
11 int *p = fn ();
12 if (i != 1)
13 __builtin_abort ();