[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CXX / class / class.mem / p14.cpp
bloba2f60618565d0fef339278f0c171624e087fcf13
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // In addition, if class T has a user-declared constructor (12.1),
4 // every non-static data member of class T shall have a name different
5 // from T.
7 struct X0 {
8 int X0; // okay
9 };
11 struct X1 {
12 int X1; // expected-error{{member 'X1' has the same name as its class}}
13 X1();
16 struct X2 {
17 X2();
18 float X2; // expected-error{{member 'X2' has the same name as its class}}