summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/pr25811-2.C
blob: 3a36dd49c2a6935020e794c429d75aaf31d8409f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// { dg-do compile }
// { dg-options -fpermissive }

struct A
{
  int const i; // { dg-message "should be initialized" }
};

struct B
{
  int& r; // { dg-message "should be initialized" }
};

struct C
{
  int const i : 1; // { dg-message "should be initialized" }
};

void f()
{
  new A;  // { dg-warning "uninitialized" }
  new B;  // { dg-warning "uninitialized" }
  new C;  // { dg-warning "uninitialized" }
  C c;    // { dg-warning "uninitialized" }
  A a[1]; // { dg-warning "uninitialized" }
}