aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/init/pr29043.C
blob: f341f8c8f1ff59829f394ef7448c05d85a0fbf52 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// PR c++/29043
// { dg-do compile }

struct S		// { dg-error "uninitialized" "" { target c++11 } }
{
  int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};

class C
{
public:
  C() {} // { dg-error "uninitialized const member|deleted" }
  S s;
};

struct S2		// { dg-error "uninitialized" "" { target c++11 } }
{
  int& ref;   // { dg-message "should be initialized" "" { target { ! c++11 } } }
};

class C2
{
public:
  C2() {} // { dg-error "uninitialized reference member|deleted" }
  S2 s;
};

class C3
{
  C3() { }
  struct s {
    const int i;
  };
};

struct S4		// { dg-error "uninitialized" "" { target c++11 } }
{
  int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};

struct C4
{
  C4() {} // { dg-error "uninitialized const member|deleted" }
  S4 s4[ 1 ];
};

struct C5
{
  C5() {} // { dg-message "uninitialized" }   
  int const iit[ 1 ];
};