brintos

brintos / llvm-project-archived public Read only

0
0
Text · 426 B · a2f6061 Raw
20 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 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 different5// from T.6 7struct X0 {8  int X0; // okay9};10 11struct X1 {12  int X1; // expected-error{{member 'X1' has the same name as its class}}13  X1();14};15 16struct X2 {17  X2();18  float X2; // expected-error{{member 'X2' has the same name as its class}}19};20