aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/nonnull-3.c
blob: 42081c889f265132be17e27c5c6e49a7cf2cae2e (plain)
1
2
3
4
5
6
7
8
9
10
11
/* PR c++/79984 */
/* { dg-do compile } */
/* { dg-options "-Wnonnull-compare" } */

enum { r = 1 };

__attribute__ ((nonnull (r))) int
f (int *p)
{
  return p == 0; /* { dg-warning "'nonnull' argument 'p' compared to NULL" } */
}