aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-nullptr-5.c
blob: 54266af70fb3c5009d14ed79d3a1af4776fdc440 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Test that we don't lose side-effects when converting from nullptr_t.  */
/* { dg-do run } */
/* { dg-options "-std=c23 -pedantic-errors" } */

int i;
nullptr_t fn () { ++i; return nullptr; }

int
main ()
{
  int *p = fn ();
  if (i != 1)
    __builtin_abort ();
}