p2.cpp revision 762bb9d0ad20320b9f97a841dce57ba5e8e48b07
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %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