summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wunused-5.C
blob: 8a8d9d280fc14b50312f88b9254ffe4a98b2f65c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR opt/14288 */
/* { dg-do compile } */
/* { dg-options "-O -Wall" } */

volatile int sink;
extern int foo(int);

struct S
{
  int x;

  S() { x = foo(0); }
  ~S() { sink = x; }
};

int test(bool p)
{
  return p ? foo(S().x) : 0;	/* { dg-bogus "uninitialized" } */
}