p2.cpp revision d61db33331c264d6361283602b248a7423040597
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
2
3struct A {
4private:
5  int : 0;
6};
7
8A a = { };
9A a2 = { 1 }; // expected-error{{excess elements in struct initializer}}
10
11struct B {
12  const int : 0;
13};
14
15B b;
16
17void testB() {
18  B b2(b);
19  B b3(static_cast<B&&>(b2));
20  b = b;
21  b = static_cast<B&&>(b);
22}
23