summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/attrib49.C
blob: 99c6154f1a55b785fb74164d1455ff562786b314 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/60765
// { dg-options "-Wall -Wunused-parameter" }

struct foo
{
} x;

void (foo::*g) (int *) __attribute__ ((nonnull (2)));

void
fun1 (void (foo::*f) (int *) __attribute__ ((nonnull (2))))
{
    (x.*f) ((int *) 0); // { dg-warning "null argument" }
}

void
fun2 (void (foo::*f) () __attribute__ ((nonnull, unused))) // { dg-bogus "unused" }
{
    (x.*g) ((int *) 0); // { dg-warning "null argument" }
}