[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CXX / class / class.bit / p2.cpp
blob8b2436a869ba0299953dcac78bbc25dc347390d6
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3 struct A {
4 private:
5 int : 0;
6 };
8 A a = { };
9 A a2 = { 1 }; // expected-error{{excess elements in struct initializer}}
11 struct B {
12 const int : 0; // expected-error{{anonymous bit-field cannot have qualifiers}}
15 B b;
17 void testB() {
18 B b2(b);
19 B b3(static_cast<B&&>(b2));
20 b = b;
21 b = static_cast<B&&>(b);