1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3struct A {
4   A() : value(), cvalue() { } // expected-error {{reference to type 'int' requires an initializer}}
5   int &value;
6   const int cvalue;
7};
8
9struct B {
10};
11
12struct X {
13   X() { }      // expected-error {{constructor for 'X' must explicitly initialize the reference member 'value'}} \
14                // expected-error {{constructor for 'X' must explicitly initialize the const member 'cvalue'}} \
15                // expected-error {{constructor for 'X' must explicitly initialize the reference member 'b'}} \
16                // expected-error {{constructor for 'X' must explicitly initialize the const member 'cb'}}
17   int &value; // expected-note{{declared here}}
18   const int cvalue; // expected-note{{declared here}}
19   B& b; // expected-note{{declared here}}
20   const B cb; // expected-note{{declared here}}
21};
22
23
24// PR5924
25struct bar {};
26bar xxx();
27
28struct foo {
29  foo_t a;  // expected-error {{unknown type name 'foo_t'}}
30  foo() : a(xxx()) {}  // no error here.
31};
32