You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cxx-note {{default constructor of 'V' is implicitly deleted because field 'a' of const-qualified type 'const struct A' would not be initialized}}
15
+
16
+
voidf() {
17
+
structSs1; // c-warning {{default initialization of an object of type 'struct S' with const member leaves the object unitialized and is incompatible with C++}} \
18
+
cxx-error {{call to implicitly-deleted default constructor of 'struct S'}}
19
+
structSs2= { 0 };
20
+
}
21
+
voidg() {
22
+
structTt1; // c-warning {{default initialization of an object of type 'struct T' with const member leaves the object unitialized and is incompatible with C++}} \
23
+
cxx-error {{call to implicitly-deleted default constructor of 'struct T'}}
24
+
structTt2= { { 0 } };
25
+
}
26
+
voidh() {
27
+
structUu1= { { 0 } };
28
+
structUu2= { { 0 }, 0 };
29
+
}
30
+
voidx() {
31
+
structVv1; // c-warning {{default initialization of an object of type 'struct V' with const member leaves the object unitialized and is incompatible with C++}} \
32
+
cxx-error {{call to implicitly-deleted default constructor of 'struct V'}}
33
+
structVv2= { 0 };
34
+
structVv3= { 0, { 0 } };
35
+
}
36
+
37
+
// Test a tentative definition which does eventually get an initializer.
38
+
externconstinti;
39
+
constinti=12;
40
+
41
+
staticconstintj; // c-warning {{default initialization of an object of type 'const int' is incompatible with C++}} \
42
+
cxx-error {{default initialization of an object of const type 'const int'}}
43
+
constintk; // c-warning {{default initialization of an object of type 'const int' is incompatible with C++}} \
44
+
cxx-error {{default initialization of an object of const type 'const int'}}
45
+
conststructSs; // c-warning {{default initialization of an object of type 'const struct S' is incompatible with C++}} \
46
+
cxx-error {{call to implicitly-deleted default constructor of 'const struct S'}}
47
+
48
+
voidfunc() {
49
+
constinta; // c-warning {{default initialization of an object of type 'const int' leaves the object unitialized and is incompatible with C++}} \
50
+
cxx-error {{default initialization of an object of const type 'const int'}}
51
+
staticconstintb; // c-warning {{default initialization of an object of type 'const int' is incompatible with C++}} \
52
+
cxx-error {{default initialization of an object of const type 'const int'}}
0 commit comments