blob: 6b992973614ca38e1b2d82aedef89f6c1972a942 [file] [log] [blame]
Fariborz Jahanian6c813e12009-10-27 16:51:19 +00001// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
2
3struct A {
4 ~A();
5 const int i; // expected-note {{declared at}}
6};
7
8struct B {
9 // B is a non-POD with no user-written constructor.
10 // It has a nontrivial generated constructor.
11 const int i[12]; // expected-note {{declared at}}
12 A a;
13};
14
15int main () {
16 // Value-initializing a "B" doesn't call the default constructor for
17 // "B"; it value-initializes the members of B. Therefore it shouldn't
18 // cause an error on generation of the default constructor for the
19 // following:
20 new B(); // expected-error {{cannot define the implicit default constructor for 'struct B', because const member 'i'}}
21 (void)B();
22 (void)A(); // expected-error {{cannot define the implicit default constructor for 'struct A', because const member 'i'}}
23}