aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/attr-warn-unused-result-2.c
blob: f35198dc6fa731571260642686975e5d35b9079d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* PR c/82134 */
/* { dg-do compile } */
/* { dg-additional-options -Wno-c++-compat { target c } } */

struct S {};

__attribute__((warn_unused_result)) struct S foo();

void use_s(struct S);

void
test (void)
{
  struct S s = foo(); /* { dg-bogus "ignoring return value of" } */
  use_s(foo()); /* { dg-bogus "ignoring return value of" } */
}