1 // RUN: clang-cc -fsyntax-only -verify %s
3 struct X1
{ // has no implicit default constructor
7 struct X2
: X1
{ // expected-note {{'struct X2' declared here}} \
8 // expected-note {{'struct X2' declared here}}
12 struct X3
: public X2
{
14 X3 x3
; // expected-error {{cannot define the implicit default constructor for 'struct X3', because member 'struct X2' does not have any default constructor}}
19 X2
& rx2
; // expected-note {{declared at}}
22 X4 x4
; // expected-error {{cannot define the implicit default constructor for 'struct X4', because base class 'struct X2' does not have any default constructor}} \
23 // expected-error {{cannot define the implicit default constructor for 'struct X4', because reference member 'rx2' cannot be default-initialized}}
26 struct Y1
{ // has no implicit default constructor
35 struct Y3
: public Y2
{
49 int& z
; // expected-note {{declared at}}
50 const int c1
; // expected-note {{declared at}}
54 Z1 z1
; // expected-error {{cannot define the implicit default constructor for 'struct Z1', because reference member 'z' cannot be default-initialized}} \
55 // expected-error {{cannot define the implicit default constructor for 'struct Z1', because const member 'c1' cannot be default-initialized}}