summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wuninitialized-1.C
blob: 7b1b90b944d3ce8269418556632710072930f3da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-options "-O2 -Wuninitialized" } */

struct Empty { Empty() {} }; /* { dg-bogus "uninitialized" } */
struct Other {
    Other(const Empty& e_) : e(e_) {}
    Empty e;
};
void bar(Other&);
void foo()
{
  Empty e;
  Other o(e);
  bar(o);
}